Closed Bug 1317198 Opened 7 years ago Closed 7 years ago

Crash in java.lang.NullPointerException: Attempt to invoke virtual method ''int org.mozilla.gecko.Tab.getId()'' on a null object reference at org.mozilla.gecko.GeckoApp.onPause(


(Firefox for Android Graveyard :: General, defect)

Not set


(firefox52+ fixed, firefox53- fixed)

Firefox 53
Tracking Status
firefox52 + fixed
firefox53 - fixed


(Reporter: sebastian, Assigned: droeh, Mentored)



(Keywords: crash, Whiteboard: [TPE-1])

Crash Data


(1 file, 1 obsolete file)

This bug was filed from the Socorro interface and is 
report bp-ddf12a38-15bc-4ecb-92b0-17c112161114.
This seems to be caused by Bug 1305439, see the bottom of:
Depends on: 1305439
Mentor: ahunt
Attached patch Null-check the Tab (obsolete) — Splinter Review
This just checks if the tab is null before attempting to update the lastSelectedTabId; I didn't think it was possible to hit GeckoApp.onPause() with Tabs.mSelectedTab still being null, but apparently I was mistaken.
Assignee: nobody → droeh
Attachment #8810418 - Flags: review?(s.kaspari)
Comment on attachment 8810418 [details] [diff] [review]
Null-check the Tab

Review of attachment 8810418 [details] [diff] [review]:

::: mobile/android/base/java/org/mozilla/gecko/
@@ +2155,5 @@
>          }
> +        final Tab selectedTab = Tabs.getInstance().getSelectedTab();
> +        if (selectedTab != null) {
> +            lastSelectedTabId = Tabs.getInstance().getSelectedTab().getId();

This probably should use 'selectedTab' instead of requesting it again?
Attachment #8810418 - Flags: review?(s.kaspari) → review+
Yup, meant to use selectedTab there. The dangers of copy and paste :)

Carrying over the r+.
Attachment #8810418 - Attachment is obsolete: true
Attachment #8811302 - Flags: review+
Pushed by
Check if a tab is null before trying to get its id in GeckoApp.onPause() r=sebastian
Closed: 7 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 53
1 instance of this crash has been spotted in aurora (52) too, we should probably uplift it?
[Tracking Requested - why for this release]:

Adjusting flags - I think in Comment 8 Andrzej wanted to track for 52, not 53 where it is resolved fixed.
Comment on attachment 8811302 [details] [diff] [review]
Null-check the Tab v1.1

Approval Request Comment
[Feature/regressing bug #]:1305439
[User impact if declined]:Potential for crashes
[Describe test coverage new/current, TreeHerder]:
[Risks and why]: Low-risk, we just check if the selected tab is null and fall back to the old behavior if it is.
[String/UUID change made/needed]:
Attachment #8811302 - Flags: approval-mozilla-aurora?
Comment on attachment 8811302 [details] [diff] [review]
Null-check the Tab v1.1

fix possible fennec crash, take for aurora52
Attachment #8811302 - Flags: approval-mozilla-aurora? → approval-mozilla-aurora+
Product: Firefox for Android → Firefox for Android Graveyard
You need to log in before you can comment on or make changes to this bug.