Bug 1090287 - Check that the selected tab is not null before updating progress visibility. r=rnewman
authorMichael Comella <michael.l.comella@gmail.com>
Thu, 29 Jan 2015 17:44:07 -0800
changeset 226900 068b172026ef63d92f2a8607c3f03c81f577568a
parent 226899 ee25e5277ab6ce76d8cef914bd269d306c8b3cf1
child 226901 9289992e25ebda9b89259a4efb868c9519494c47
push id54950
push userphilringnalda@gmail.com
push dateSat, 31 Jan 2015 17:14:09 +0000
treeherdermozilla-inbound@37cbadfe1bc1 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersrnewman
bugs1090287
milestone38.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 1090287 - Check that the selected tab is not null before updating progress visibility. r=rnewman
mobile/android/base/toolbar/BrowserToolbar.java
--- a/mobile/android/base/toolbar/BrowserToolbar.java
+++ b/mobile/android/base/toolbar/BrowserToolbar.java
@@ -541,17 +541,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);