ibm-bluemix-mobile-services / bms-clientsdk-android-push

Android Push notifications SDK for IBM Cloud Mobile Services
Apache License 2.0
10 stars 12 forks source link

NullpointerException in writeToParcel #129

Closed SebastianSingle99 closed 4 years ago

SebastianSingle99 commented 4 years ago

My app often crashes with this stacktrace, using version 4.2.0:

Fatal Exception: java.lang.NullPointerException: Attempt to invoke virtual method 'java.lang.String org.json.JSONObject.toString()' on a null object reference at com.ibm.mobilefirstplatform.clientsdk.android.push.internal.MFPInternalPushMessage.writeToParcel(MFPInternalPushMessage.java:405) at android.os.Parcel.writeParcelable(Parcel.java:1699) at android.os.Parcel.writeValue(Parcel.java:1605) at android.os.Parcel.writeArrayMapInternal(Parcel.java:891) at android.os.BaseBundle.writeToParcelInner(BaseBundle.java:1579) at android.os.Bundle.writeToParcel(Bundle.java:1233) at android.os.Parcel.writeBundle(Parcel.java:931) at android.content.Intent.writeToParcel(Intent.java:10667) at android.app.IActivityManager$Stub$Proxy.broadcastIntent(IActivityManager.java:3716) at android.app.ContextImpl.sendBroadcast(ContextImpl.java:1071) at android.content.ContextWrapper.sendBroadcast(ContextWrapper.java:449) at com.ibm.mobilefirstplatform.clientsdk.android.push.api.MFPPushIntentService.onNotificationReceived(MFPPushIntentService.java:195)...

This line produces the crash dest.writeString(channelJson.toString());. Seems like a null-check is required here.

AnanthaKrish commented 4 years ago

@SebastianSingle99 Hi, We have the fix ready for this, will let you know once its released(Today). Thanks you.

AnanthaKrish commented 4 years ago

@SebastianSingle99 Please use the version 4.2.1 .

SebastianSingle99 commented 4 years ago

Thanks ;)