Closed Bug 981682 Opened 6 years ago Closed 6 years ago

crash in java.lang.NullPointerException: at org.mozilla.gecko.prompts.Prompt.closeDialog(Prompt.java)

Categories

(Firefox for Android :: General, defect, critical)

30 Branch
All
Android
defect
Not set
critical

Tracking

()

RESOLVED FIXED
Firefox 30

People

(Reporter: aaronmt, Assigned: wesj)

Details

(Keywords: crash)

Crash Data

Attachments

(1 file)

This bug was filed from the Socorro interface and is 
report bp-defb0a40-fa0d-40b9-9174-bf9522140308.
=============================================================

java.lang.NullPointerException
	at org.mozilla.gecko.prompts.Prompt.closeDialog(Prompt.java:403)
	at org.mozilla.gecko.prompts.Prompt.onClick(Prompt.java:211)
	at com.android.internal.app.AlertController$ButtonHandler.handleMessage(AlertController.java:166)
	at android.os.Handler.dispatchMessage(Handler.java:99)
	at android.os.Looper.loop(Looper.java:137)
	at android.app.ActivityThread.main(ActivityThread.java:4745)
	at java.lang.reflect.Method.invokeNative(Native Method)
	at java.lang.reflect.Method.invoke(Method.java:511)
	at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:786)
	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553)
	at dalvik.system.NativeStart.main(Native Method)
Assignee: nobody → wjohnston
Attached patch PatchSplinter Review
Not sure how this is happening. i.e. it looks likd mDialog is null, but we own its lifecycle and its only removed in finishDialog. I was careful to make sure that it was only called after the dialog was removed, and still don't see a path for that to happen.

That said, that's fragile and we don't actually need this cleanup code anymore. Most of it is from a time where Prompt.java had a singleton that we needed to cleanup. Now we generate a new prompt for each dialog and throw it away when we're done.
Attachment #8388808 - Flags: review?(bnicholson)
Comment on attachment 8388808 [details] [diff] [review]
Patch


>+    private evoid notifyClosing(JSONObject aReturn) {

typo: evoid
Comment on attachment 8388808 [details] [diff] [review]
Patch

Review of attachment 8388808 [details] [diff] [review]:
-----------------------------------------------------------------

::: mobile/android/base/prompts/Prompt.java
@@ +399,5 @@
>       * is closing.
>       */
>      private void closeDialog(int which) {
>          JSONObject ret = new JSONObject();
> +        if (mDialog != null) {

You could remove this since you don't clear out mDialog anymore.
Attachment #8388808 - Flags: review?(bnicholson) → review+
Also just a reminder to fix evoid from comment 2.
https://hg.mozilla.org/mozilla-central/rev/39cc22fbd6af
Status: NEW → RESOLVED
Closed: 6 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 30
You need to log in before you can comment on or make changes to this bug.