Azure / azure-notificationhubs-android

Android SDK and Samples for Azure Notification Hubs
Apache License 2.0
33 stars 63 forks source link

[BUG] App is crashing in the background on notification received event. #215

Closed amandshahu closed 3 years ago

amandshahu commented 3 years ago

Describe the bug NullPointer exception on onPushNotificationReceived method of NotificationListener interface, due to it app is crashing. this is a background and random crash whenever a notification is received.

Exception or Stack Trace

java.lang.NullPointerException: Attempt to invoke interface method 'void com.microsoft.windowsazure.messaging.notificationhubs.NotificationListener.onPushNotificationReceived(android.content.Context, com.google.firebase.messaging.RemoteMessage)' on a null object reference
        at com.microsoft.windowsazure.messaging.notificationhubs.FirebaseReceiver.onMessageReceived(FirebaseReceiver.java:52)
        at com.google.firebase.messaging.FirebaseMessagingService.dispatchMessage(com.google.firebase:firebase-messaging@@22.0.0:13)
        at com.google.firebase.messaging.FirebaseMessagingService.passMessageIntentToSdk(com.google.firebase:firebase-messaging@@22.0.0:8)
        at com.google.firebase.messaging.FirebaseMessagingService.handleMessageIntent(com.google.firebase:firebase-messaging@@22.0.0:3)
        at com.google.firebase.messaging.FirebaseMessagingService.handleIntent(com.google.firebase:firebase-messaging@@22.0.0:3)
        at com.google.firebase.messaging.EnhancedIntentService.lambda$processIntent$0$EnhancedIntentService(com.google.firebase:firebase-messaging@@22.0.0:1)
        at com.google.firebase.messaging.EnhancedIntentService$$Lambda$0.run(Unknown Source:6)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
        at com.google.android.gms.common.util.concurrent.zza.run(com.google.android.gms:play-services-basement@@17.3.0:6)
        at java.lang.Thread.run(Thread.java:764)

To Reproduce Unable to understand the reproducing steps, we got to know only through Firebase Crashlytics.

Code Snippet Add the code snippet that causes the issue.

Expected behavior The crashes happening in the background, It should not be crash.

Screenshots crash

Setup (please complete the following information):

Additional context Add any other context about the problem here.

Information Checklist Kindly make sure that you have added all the following information above and checkoff the required fields otherwise we will treat the issuer as an incomplete report

marstr commented 3 years ago

Howdy - please review this thread: https://github.com/Azure/azure-notificationhubs-android/issues/191

If you believe it is the same issue:

If you believe it is a different issue, please "@" mention me again and I'll take another look!

amandshahu commented 3 years ago

@marstr Thanks for the update, It is a duplicate issue hence I have closed it.