Bug 1090287 - Check that the selected tab is not null before updating progress visibility. r=rnewman, a=lmandel
authorMichael Comella <michael.l.comella@gmail.com>
Thu, 29 Jan 2015 17:44:07 -0800
changeset 243665 0a9d521bf670
parent 243664 07cc8d56cde8
child 243666 2e542912a7c0
push id4430
push userryanvm@gmail.com
push date2015-02-03 22:04 +0000
treeherdermozilla-beta@2e542912a7c0 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersrnewman, lmandel
bugs1090287
milestone36.0
Bug 1090287 - Check that the selected tab is not null before updating progress visibility. r=rnewman, a=lmandel
mobile/android/base/toolbar/BrowserToolbar.java
--- a/mobile/android/base/toolbar/BrowserToolbar.java
+++ b/mobile/android/base/toolbar/BrowserToolbar.java
@@ -543,17 +543,21 @@ public abstract class BrowserToolbar ext
             case LOAD_ERROR:
             case LOCATION_CHANGE:
                 isSwitchingTabs = false;
         }
     }
 
     private void updateProgressVisibility() {
         final Tab selectedTab = Tabs.getInstance().getSelectedTab();
-        updateProgressVisibility(selectedTab, selectedTab.getLoadProgress());
+        // The selected tab may be null if GeckoApp (and thus the
+        // selected tab) are not yet initialized (bug 1090287).
+        if (selectedTab != null) {
+            updateProgressVisibility(selectedTab, selectedTab.getLoadProgress());
+        }
     }
 
     private void updateProgressVisibility(Tab selectedTab, int progress) {
         if (!isEditing() && selectedTab.getState() == Tab.STATE_LOADING) {
             progressBar.setProgress(progress);
             progressBar.setVisibility(View.VISIBLE);
         } else {
             progressBar.setVisibility(View.GONE);