Bug 816314: NPE in AwesomeBar while checking private browsing mode. [r=bnicholson]
☠☠ backed out by 9eb8b4bd265d ☠ ☠
authorSriram Ramasubramanian <sriram@mozilla.com>
Wed, 28 Nov 2012 16:38:32 -0800
changeset 114428 7b516748a65c26b1999e20ea37276694c266181b
parent 114427 91dfecde7a96c0d9e40fdd79701d4dc4917f6010
child 114429 7fe5182d67862f691375879eb9dabf8b7e7e7f9d
push id23917
push useremorley@mozilla.com
push dateThu, 29 Nov 2012 14:20:29 +0000
treeherdermozilla-central@c72d38e7a212 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbnicholson
bugs816314
milestone20.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 816314: NPE in AwesomeBar while checking private browsing mode. [r=bnicholson]
mobile/android/base/AwesomeBar.java
--- a/mobile/android/base/AwesomeBar.java
+++ b/mobile/android/base/AwesomeBar.java
@@ -121,17 +121,19 @@ public class AwesomeBar extends GeckoAct
         String currentUrl = intent.getStringExtra(CURRENT_URL_KEY);
         if (currentUrl != null) {
             mText.setText(currentUrl);
             mText.selectAll();
         }
 
         mTarget = intent.getStringExtra(TARGET_KEY);
         if (mTarget.equals(Target.CURRENT_TAB.name())) {
-            if (Tabs.getInstance().getSelectedTab().isPrivate()) {
+            // Bug 816332 needs to be fixed to avoid AwesomeBar opening before tabs exist.
+            Tab tab = Tabs.getInstance().getSelectedTab();
+            if (tab != null && tab.isPrivate()) {
                 BrowserToolbarBackground mAddressBarBg = (BrowserToolbarBackground) findViewById(R.id.address_bar_bg);
                 mAddressBarBg.setPrivateMode(true);
 
                 TabsButton mTabs = (TabsButton) findViewById(R.id.dummy_tab);
                 if (mTabs != null)
                     mTabs.setPrivateMode(true);
 
                 mText.setPrivateMode(true);