dpa99c / cordova-plugin-request-location-accuracy

Cordova/Phonegap plugin for Android and iOS to request enabling/changing of Location Services by triggering a native dialog
96 stars 62 forks source link

RequestLocationAccuracy.java line 287 #29

Closed pooi-pooi closed 7 years ago

pooi-pooi commented 7 years ago

Hello guys, Im having a problem with cordova-plugin-request-location-accuracy 2.2.0

Looking on our Fabric, we got the following error:

RequestLocationAccuracy.java line 287
cordova.plugin.RequestLocationAccuracy.handleSuccess

on:

Full stack trace: issue_2_crash_58E55B66025300014AB8903D4E93726E_a464d99a41864b0d89875eff7c5e9acf_0_v1.txt

Google Play Services: image

Do you know how to resolve that? Thank you

dpa99c commented 7 years ago

Hi, thanks for the detailed info.

From it, I can see the problem: on receiving a successful response from the permissions activity, the success handler attempts to use the current context to invoke the JS callback (line 287.

However, it's possible that Android can have killed the original Cordova activity when it switched to the permissions activity, make the context reference null.

I'll fix this with a simple "not null" check before attempting to invoke the callback context.

dpa99c commented 7 years ago

The fix has been released in a patch: cordova-plugin-request-location-accuracy@2.2.1