Bug 703765 - The updatePopup call after Tab:Close can result in a NPE. r=mfinkle
authorMargaret Leibovic <margaret.leibovic@gmail.com>
Mon, 21 Nov 2011 14:24:24 -0800
changeset 83566 cf2c2a927197e80605073efa829d51e7afd7814a
parent 83565 afc56afc464fa187a9126462204d71ea6d5dd6b7
child 83567 dac80a8d25d44e329bfa1138727260a3774a07b8
push id519
push userakeybl@mozilla.com
push dateWed, 01 Feb 2012 00:38:35 +0000
treeherdermozilla-beta@788ea1ef610b [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmfinkle
bugs703765
milestone11.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 703765 - The updatePopup call after Tab:Close can result in a NPE. r=mfinkle
mobile/android/base/DoorHangerPopup.java
--- a/mobile/android/base/DoorHangerPopup.java
+++ b/mobile/android/base/DoorHangerPopup.java
@@ -106,16 +106,21 @@ public class DoorHangerPopup extends Pop
         mContent.addView(dh);
 
         updatePopup();
     }
 
     // Updates popup contents to show doorhangers for the selected tab
     public void updatePopup() {
         Tab tab = Tabs.getInstance().getSelectedTab();
+        if (tab == null) {
+            hidePopup();
+            return;
+        }
+        
         Log.i(LOGTAG, "Showing all doorhangers for tab: " + tab.getId());
  
         HashMap<String, DoorHanger> doorHangers = tab.getDoorHangers();
         // Hide the popup if there aren't any doorhangers to show
         if (doorHangers == null || doorHangers.size() == 0) {
             hidePopup();
             return;
         }