ibm-bluemix-mobile-services/bms-clientsdk-cordova-plugin-push

Android release build crashes on unregisterDevice()

Opened this issue · 0 comments

During a release build for Android, when I call the unregisterDevice() on the BMSPush component, the application crashes. Probably, there is something wrong when the device has not been registered before and unregisterDevice() is called.

This is the log:

E/AndroidRuntime( 4040): FATAL EXCEPTION: pool-2-thread-2
E/AndroidRuntime( 4040): Process: ***MUTED PACKAGE NAME***, PID: 4040
E/AndroidRuntime( 4040): java.lang.NullPointerException: Attempt to invoke virtual method 'boolean java.lang.String.isEmpty()' on a null object reference
E/AndroidRuntime( 4040): 	at com.ibm.mobilefirstplatform.clientsdk.android.push.api.MFPPush.getApplicationId(MFPPush.java:682)
E/AndroidRuntime( 4040): 	at com.ibm.mobilefirstplatform.clientsdk.android.push.internal.MFPPushInvoker.<init>(MFPPushInvoker.java:54)
E/AndroidRuntime( 4040): 	at com.ibm.mobilefirstplatform.clientsdk.android.push.internal.MFPPushInvoker.newInstance(MFPPushInvoker.java:60)
E/AndroidRuntime( 4040): 	at com.ibm.mobilefirstplatform.clientsdk.android.push.api.MFPPush.unregister(MFPPush.java:538)
E/AndroidRuntime( 4040): 	at com.ibm.mobilefirstplatform.clientsdk.cordovaplugins.push.CDVBMSPush$4.run(CDVBMSPush.java:183)
E/AndroidRuntime( 4040): 	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112)
E/AndroidRuntime( 4040): 	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587)
E/AndroidRuntime( 4040): 	at java.lang.Thread.run(Thread.java:818)

All functions are called after deviceready is fired, device registration and notification handling work as expected.

Versions (snippet from config.xml):

<plugin name="bms-core" spec="~2.3.7"/>
<plugin name="bms-push" spec="~3.1.2"/>