Bug 1317198 - Check if a tab is null before trying to get its id in GeckoApp.onPause() r=sebastian
--- 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.