AltBeacon/android-beacon-library

NPE crash in latest version (2.20.1) in StartupBroadcastReceiver

mlagerberg opened this issue · 1 comments

Expected behavior

Run without crashing

Actual behavior

Crashes with an NPE:

Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'boolean java.lang.String.equals(java.lang.Object)' on a null object reference
                                      	at org.altbeacon.beacon.startup.StartupBroadcastReceiver.onReceive(StartupBroadcastReceiver.java:33)

Steps to reproduce this behavior

Start monitoring with a foreground service.

The error originates from this commit:

b66660e

There should be a null-check around intent.getAction() since the broadcast receiver is not always started with a non-null action.

Mobile device model and OS version

Android Beacon Library version

IMPORTANT: This forum is reserved for feature requests or reproducible bugs with the library itself. If you need help with using the library with your project, please open a new question on StackOverflow.com.

Thanks for this report. A fix is in #1167 and a new release will be available later today.