Bug 1317198 - Check if a tab is null before trying to get its id in GeckoApp.onPause() r=sebastian
authorDylan Roeh <droeh@mozilla.com>
Wed, 16 Nov 2016 09:07:27 -0600
changeset 322805 0f8126c38179a6475b550ed97f0dfac42c4899b6
parent 322804 efe1e3b8cc1714dbdc456b80dfa4578a5192f5b7
child 322806 326453c91392f00a0e83e82b48e67c28acc576b4
push id83974
push userdroeh@mozilla.com
push dateWed, 16 Nov 2016 15:40:54 +0000
treeherdermozilla-inbound@0f8126c38179 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssebastian
bugs1317198
milestone53.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1317198 - Check if a tab is null before trying to get its id in GeckoApp.onPause() r=sebastian
mobile/android/base/java/org/mozilla/gecko/GeckoApp.java
--- a/mobile/android/base/java/org/mozilla/gecko/GeckoApp.java
+++ b/mobile/android/base/java/org/mozilla/gecko/GeckoApp.java
@@ -2151,17 +2151,20 @@ public abstract class GeckoApp
     @Override
     public void onPause()
     {
         if (mIsAbortingAppLaunch) {
             super.onPause();
             return;
         }
 
-        lastSelectedTabId = Tabs.getInstance().getSelectedTab().getId();
+        final Tab selectedTab = Tabs.getInstance().getSelectedTab();
+        if (selectedTab != null) {
+            lastSelectedTabId = selectedTab.getId();
+        }
         lastActiveGeckoApp = new WeakReference<GeckoApp>(this);
 
         final HealthRecorder rec = mHealthRecorder;
         final Context context = this;
 
         // In some way it's sad that Android will trigger StrictMode warnings
         // here as the whole point is to save to disk while the activity is not
         // interacting with the user.