novoda / merlin

Observes network connection status & gives callbacks
Other
543 stars 79 forks source link

NPE on ConnectivityCallbacks.notifyMerlinService #199

Closed neteinstein closed 2 years ago

neteinstein commented 4 years ago

Problem

Version 1.2.1

Fatal Exception: java.lang.NullPointerException: Attempt to invoke interface method 'boolean com.novoda.merlin.MerlinService$a.a()' on a null object reference
       at com.novoda.merlin.ConnectivityCallbacks.notifyMerlinService(ConnectivityCallbacks.java:36)
       at com.novoda.merlin.ConnectivityCallbacks.onAvailable(ConnectivityCallbacks.java:22)
       at android.net.ConnectivityManager$CallbackHandler.handleMessage(ConnectivityManager.java:2765)
       at android.os.Handler.dispatchMessage(Handler.java:110)
       at android.os.Looper.loop(Looper.java:203)
       at android.os.HandlerThread.run(HandlerThread.java:61)

Potential Solution

We might need to add some validations for nulls.

Impact

This appeared on crashes at Firebase Crashlytics when using an app with this integrated.

blundell commented 4 years ago

Perhaps its a proguard rule that needs adding rather than a null check?