Bug 752172 - (Part 2) Protect against null selected tab in SiteIdentityPopup. r=mfinkle
authorMargaret Leibovic <margaret.leibovic@gmail.com>
Mon, 14 May 2012 11:44:42 -0700
changeset 93891 d0f6caf941d106a9ccab935b8f4069b99e121afd
parent 93890 a02adac1eaf3b406b488ab8380f26f6176db6d13
child 93892 90ef8e055139dd29bb37482e69fdb601d022c6be
push id22688
push useremorley@mozilla.com
push dateTue, 15 May 2012 11:33:31 +0000
treeherdermozilla-central@b69d000b726a [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmfinkle
bugs752172
milestone15.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 752172 - (Part 2) Protect against null selected tab in SiteIdentityPopup. r=mfinkle
mobile/android/base/SiteIdentityPopup.java
--- a/mobile/android/base/SiteIdentityPopup.java
+++ b/mobile/android/base/SiteIdentityPopup.java
@@ -75,17 +75,23 @@ public class SiteIdentityPopup extends P
 
         mLarry = (ImageView) layout.findViewById(R.id.larry);
         mArrow = (ImageView) layout.findViewById(R.id.arrow);
 
         mInflated = true;
     }
 
     public void show(int leftMargin) {
-        JSONObject identityData = Tabs.getInstance().getSelectedTab().getIdentityData();
+        Tab selectedTab = Tabs.getInstance().getSelectedTab();
+        if (selectedTab == null) {
+            Log.e(LOGTAG, "Selected tab is null");
+            return;
+        }
+
+        JSONObject identityData = selectedTab.getIdentityData();
         if (identityData == null) {
             Log.e(LOGTAG, "Tab has no identity data");
             return;
         }
 
         String mode;
         try {
             mode = identityData.getString("mode");