diff --git a/mobile/android/base/java/org/mozilla/gecko/GeckoApp.java b/mobile/android/base/java/org/mozilla/gecko/GeckoApp.java index 99d26752479f..fd88f72226e3 100644 --- a/mobile/android/base/java/org/mozilla/gecko/GeckoApp.java +++ b/mobile/android/base/java/org/mozilla/gecko/GeckoApp.java @@ -2156,7 +2156,10 @@ public abstract class GeckoApp return; } - lastSelectedTabId = Tabs.getInstance().getSelectedTab().getId(); + final Tab selectedTab = Tabs.getInstance().getSelectedTab(); + if (selectedTab != null) { + lastSelectedTabId = selectedTab.getId(); + } lastActiveGeckoApp = new WeakReference(this); final HealthRecorder rec = mHealthRecorder;