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

NPE crash in SenderService.onHandleIntent due to null Intent #500

Closed
MarcBernstein opened this issue Aug 26, 2016 · 5 comments
Closed

NPE crash in SenderService.onHandleIntent due to null Intent #500

MarcBernstein opened this issue Aug 26, 2016 · 5 comments

Comments

@MarcBernstein
Copy link

After updating ACRA to 4.9.0, we started seeing these crash traces showing up:

Fatal Exception: java.lang.NullPointerException: Attempt to invoke virtual method 'boolean android.content.Intent.getBooleanExtra(java.lang.String, boolean)' on a null object reference
       at org.acra.sender.SenderService.onHandleIntent(SenderService.java:35)
       at android.app.IntentService$ServiceHandler.handleMessage(IntentService.java:66)
       at android.os.Handler.dispatchMessage(Handler.java:102)
       at android.os.Looper.loop(Looper.java:158)
       at android.os.HandlerThread.run(HandlerThread.java:61)

We're using the .aar to include the ACRA lib.

Taking a look at SenderService.onHandleIntent(Intent), it has the Intent parameter annotated as @NonNull but the IntentService that SenderService is extending has this parameter marked as @Nullable.

See source for IntentService.onHandleIntent(Intent).

It states that the intent passed in can occasionally be null when the service is being restarted. In this case I guess just a null check and return in SenderService.onHandleIntent would resolve the bug. Upon service restart I'm guessing the intent will then be non-null and the report can be sent. I can submit a PR if this is the direction you want to take.

@william-ferguson-au
Copy link
Member

Thanks Mark. I have merged @F43nd1r 's changes which fix this.

Your beard has grown much thicker since Google IO 2012.

@MarcBernstein
Copy link
Author

Great, thanks for the heads up @william-ferguson-au. Small world, isn't it? 😉

@MarcBernstein
Copy link
Author

By the way, what is the ACRA project's policy on RC builds? Just curious as to when we can start using this change, as it's currently our app's highest crash rate.

@F43nd1r
Copy link
Member

F43nd1r commented Sep 5, 2016

I think as almost all changes since the last release were made by me and I test everything individually before proposing PRs, the master should be pretty stable.
Integration testing is pending.

@william-ferguson-au I think we could aim for a release of 4.9.1 within the next month. I'd like to see #495 and #510 in there. It also should include either #502 or #487 and #488 as an intermediate solution.

@william-ferguson-au
Copy link
Member

I'm inclined towards #487 and #488 instead of #502.
#502 looks like overkill

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

3 participants