Closed Bug 816902 Opened 9 years ago Closed 9 years ago
.lang .Null Pointer Exception: at org .mozilla .gecko .All Pages Tab .set Suggestions Enabled(All Pages Tab .java)
There are one crash in 20.0a1/20121122, bp-3d1aad0f-dd7e-4943-a05a-a82af2121125, and ten crashes in 18.0b1. java.lang.NullPointerException at org.mozilla.gecko.AllPagesTab.setSuggestionsEnabled(AllPagesTab.java:613) at org.mozilla.gecko.AllPagesTab.access$1200(AllPagesTab.java:61) at org.mozilla.gecko.AllPagesTab$6.onClick(AllPagesTab.java:599) at android.view.View.performClick(View.java:2506) at android.view.View$PerformClick.run(View.java:9112) at android.os.Handler.handleCallback(Handler.java:587) at android.os.Handler.dispatchMessage(Handler.java:92) at android.os.Looper.loop(Looper.java:130) at android.app.ActivityThread.main(ActivityThread.java:3835) at java.lang.reflect.Method.invokeNative(Native Method) at java.lang.reflect.Method.invoke(Method.java:507) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:864) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:622) at dalvik.system.NativeStart.main(Native Method) More reports at: https://crash-stats.mozilla.com/report/list?signature=java.lang.NullPointerException%3A+at+org.mozilla.gecko.AllPagesTab.setSuggestionsEnabled%28AllPagesTab.java%29
Looks like this is happening on this line, which indicates that mSuggestionsOptInPrompt is null: http://hg.mozilla.org/integration/mozilla-inbound/file/ab440f162ab8/mobile/android/base/awesomebar/AllPagesTab.java#l603 setSuggestionsEnabled() is only called in the onClick() callbacks set in showSuggestionsOptIn(). These callbacks are registered by calling findViewById() on mSuggestionsOptInPrompt; this means that mSuggestionsOptInPrompt is non-null at this point in time (or else we would crash here). The only way I think we can hit this crash is if we call setSuggestionsEnabled() after we've set mSuggestionsOptInPrompt back to null, which we do here: http://hg.mozilla.org/integration/mozilla-inbound/file/ab440f162ab8/mobile/android/base/awesomebar/AllPagesTab.java#l631. This is weird, though, since setSuggestionsEnabled() shouldn't be running more than once - maybe users are able to double-click the yes/no buttons in the prompt?
On the Galaxy S and Galaxy Note, the hit area for the buttons stays in one place, even during the animation. In other words, if I hit the "yes" button to opt-in, and the entire row has been animated to the right of the screen and is no longer visible, I can still tap where the "yes" button was. Usually, this just starts the animation over, but if I time it just right (hitting it right after the row is off the screen), I'm able to reproduce this crash. To prevent the buttons from being clicked more than once, we can remove the listeners in the click callbacks.
Attachment #687319 - Flags: review?(mark.finkle)
Attachment #687319 - Flags: review?(mark.finkle) → review+
Status: NEW → RESOLVED
Closed: 9 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 20
Comment on attachment 687319 [details] [diff] [review] Prevent suggestion prompt buttons from being clicked multiple times [Approval Request Comment] Bug caused by (feature/regressing bug #): bug 769145 (Fx18) User impact if declined: can crash in awesomescreen if opt-in button is clicked more than once Testing completed (on m-c, etc.): m-c Risk to taking this patch (and alternatives if risky): low risk - just removes listener from button once it's clicked String or UUID changes made by this patch: none
Comment on attachment 687319 [details] [diff] [review] Prevent suggestion prompt buttons from being clicked multiple times looks like a good crash to avoid shipping to users, approving uplift.
Product: Firefox for Android → Firefox for Android Graveyard
You need to log in before you can comment on or make changes to this bug.