Current Behavior
I've noticed the following crash happening in production:
Exception java.lang.NullPointerException: Attempt to invoke virtual method 'java.lang.String com.getcapacitor.PluginCall.getCallbackId()' on a null object reference
at com.capacitorjs.plugins.geolocation.GeolocationPlugin$startWatch$1.invokeSuspend (GeolocationPlugin.kt)
Expected Behavior
Not crashing on null object reference
Reproduction
Hard to say as it's a bug reported by crashlytics. However it's pretty obvious from the code that it can happen:
|
val watchId = call.callbackId |
Screenshots / Media
No response
Environment Details
Versions Affected
v7.1.6, v8.2.0
Platforms Affected
Notes / Comments
It would probably be sufficient to add a check similar to if (call == null) { return }
Current Behavior
I've noticed the following crash happening in production:
Expected Behavior
Not crashing on null object reference
Reproduction
Hard to say as it's a bug reported by crashlytics. However it's pretty obvious from the code that it can happen:
capacitor-geolocation/android/src/main/kotlin/com/capacitorjs/plugins/geolocation/GeolocationPlugin.kt
Line 223 in 1a2504a
Screenshots / Media
No response
Environment Details
Versions Affected
v7.1.6, v8.2.0
Platforms Affected
Notes / Comments
It would probably be sufficient to add a check similar to
if (call == null) { return }