Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error receiving broadcast intent #363

Closed
jrodbx opened this issue Aug 20, 2018 · 1 comment
Closed

Error receiving broadcast intent #363

jrodbx opened this issue Aug 20, 2018 · 1 comment

Comments

@jrodbx
Copy link
Contributor

jrodbx commented Aug 20, 2018

Expected behavior

No crash.

Observed behavior

java.lang.RuntimeException: Error receiving broadcast Intent { act=android.net.conn.CONNECTIVITY_CHANGE flg=0x4000010 bqHint=4 (has extras) } in com.bugsnag.android.Client$ConnectivityChangeReceiver@3906bed
        at android.app.LoadedApk$ReceiverDispatcher$Args.run(LoadedApk.java:1003)
        at android.os.Handler.handleCallback(Handler.java:739)
        at android.os.Handler.dispatchMessage(Handler.java:95)
        at android.os.Looper.loop(Looper.java:158)
        at android.app.ActivityThread.main(ActivityThread.java:7225)
        at java.lang.reflect.Method.invoke(Method.java:-2)
        at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1230)
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1120)
Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'android.net.NetworkInfo android.net.ConnectivityManager.getActiveNetworkInfo()' on a null object reference
        at com.bugsnag.android.Client$ConnectivityChangeReceiver.onReceive(Client.java:225)
        at android.app.LoadedApk$ReceiverDispatcher$Args.run(LoadedApk.java:993)
        at android.os.Handler.handleCallback(Handler.java:739)
        at android.os.Handler.dispatchMessage(Handler.java:95)
        at android.os.Looper.loop(Looper.java:158)
        at android.app.ActivityThread.main(ActivityThread.java:7225)
        at java.lang.reflect.Method.invoke(Method.java:-2)
        at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1230)
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1120)

Version

com.bugsnag:bugsnag-android:4.5.0

@fractalwrench
Copy link
Contributor

Thanks for the detailed report (and PR) @jrodbx. It seems that context.getSystemService can return a nullable - we'll update the other cases within the SDK where this could be an issue.

rich-bugsnag added a commit that referenced this issue Sep 3, 2021
task(config): add new config option AppType and pass through to android and ios
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants