Skip to content

fix: null value cannot be cast to List<String> directly #127

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Conversation

shomatan
Copy link
Contributor

@shomatan shomatan commented Nov 27, 2021

Hi.
I am using the example code to create a test project.
According to the example, the following is passed to the setup method,

      'ios': {
        'appName': 'CallKeepDemo',
      },
      'android': {
        'alertTitle': 'Permissions required',
        'alertDescription':
            'This application needs to access your phone accounts',
        'cancelButton': 'Cancel',
        'okButton': 'ok',
        'foregroundService': {
          'channelId': 'com.quando.synq.development',
          'channelName': 'Foreground service for my app',
          'notificationTitle': 'My app is running on background',
          'notificationIcon': 'Path to the resource icon of the notification',
        },
      },

If additionalPermissions parameter is not exist, I got a runtime error like the following:

package:callkeep/src/api.dart
type 'Null' is not a subtype of type 'List' in type cast

I tried to fix it once, but I'm not sure if I'm using it wrong in the first place,
or if you have any good advice, please let me know 🙇

Environments

  • Flutter: 2.5.3-stable
  • Android Emulator:
    • Pixel 4
    • Android 11.0 (Google Play)
    • API 30
    • arm64

@shomatan shomatan changed the title fix: null cannot be cast to List<String> directly fix: null value cannot be cast to List<String> directly Nov 27, 2021
@shomatan shomatan marked this pull request as ready for review November 27, 2021 08:35
@cloudwebrtc
Copy link
Member

LGTM

@cloudwebrtc cloudwebrtc merged commit 097e59d into flutter-webrtc:master Nov 27, 2021
@shomatan shomatan deleted the fix-cast-error-if-additionalPermissions-is-null branch November 27, 2021 13:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants