Skip to content
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

[Health] [Crash] onActivityResult "data" parameter can have a null value. #88

Closed
GwonHyeok opened this issue May 13, 2020 · 1 comment
Closed

Comments

@GwonHyeok
Copy link

Plugin name & version
health: ^1.0.2

Describe the bug
onActivityResult data parameter is nullable but this library isn't nullable

Caused by: java.lang.IllegalArgumentException: Parameter specified as non-null is null: method kotlin.jvm.internal.Intrinsics.checkParameterIsNotNull, parameter data
 	at cachet.plugins.health.HealthPlugin.onActivityResult(Unknown Source:2)
 	at io.flutter.app.FlutterPluginRegistry.onActivityResult(FlutterPluginRegistry.java:206)
 	at io.flutter.app.FlutterActivityDelegate.onActivityResult(FlutterActivityDelegate.java:127)
 	at io.flutter.app.FlutterFragmentActivity.onActivityResult(FlutterFragmentActivity.java:137)

To Reproduce
Steps to reproduce the behavior:

  1. if using other flutter plugin
  2. other plugin send null value to data parameter
  3. crash app

Flutter doctor

Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, v1.17.0, on Mac OS X 10.15.4 19E287, locale ko-KR)
 
[✓] Android toolchain - develop for Android devices (Android SDK version 29.0.3)
[✓] Xcode - develop for iOS and macOS (Xcode 11.4.1)
[✓] Android Studio (version 3.6)
[!] VS Code (version 1.44.2)
    ✗ Flutter extension not installed; install from
      https://marketplace.visualstudio.com/items?itemName=Dart-Code.flutter
[✓] Connected device (2 available)

! Doctor found issues in 1 category.

Additional context

HealthKit

override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent): Boolean

change to

override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?): Boolean

thanks

thomasnilsson pushed a commit that referenced this issue Jul 28, 2020
@thomasnilsson
Copy link
Contributor

Fixed in version 1.1.1

thomasnilsson pushed a commit that referenced this issue Jul 28, 2020
hibitness-quan-nguyen2 pushed a commit to hibitness/flutter-plugins that referenced this issue Dec 18, 2023
hibitness-quan-nguyen2 pushed a commit to hibitness/flutter-plugins that referenced this issue Dec 18, 2023
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

No branches or pull requests

2 participants