Bug 729247 - crash [@ java.lang.NullPointerException: at org.mozilla.gecko.DoorHangerPopup.addDoorHanger(DoorHangerPopup.java)] r=blassey
authorMark Finkle <mfinkle@mozilla.com>
Wed, 22 Feb 2012 00:12:22 -0500
changeset 88887 7feef411099641755dde2fbf4aa4cdf09709ba33
parent 88886 df37b05eaefb0a75976c11bc1dc1041d8cf7d7de
child 88888 a1f579a1ad62a97361740ca50d0cd278844d4b1c
push idunknown
push userunknown
push dateunknown
reviewersblassey
bugs729247
milestone13.0a1
Bug 729247 - crash [@ java.lang.NullPointerException: at org.mozilla.gecko.DoorHangerPopup.addDoorHanger(DoorHangerPopup.java)] r=blassey
mobile/android/base/GeckoApp.java
--- a/mobile/android/base/GeckoApp.java
+++ b/mobile/android/base/GeckoApp.java
@@ -1255,18 +1255,18 @@ abstract public class GeckoApp
         final int tabId = geckoObject.getInt("tabID");
         final JSONObject options = geckoObject.getJSONObject("options");
 
         Log.i(LOGTAG, "DoorHanger received for tab " + tabId + ", msg:" + message);
 
         mMainHandler.post(new Runnable() {
             public void run() {
                 Tab tab = Tabs.getInstance().getTab(tabId);
-                mDoorHangerPopup.addDoorHanger(message, value, buttons,
-                                                           tab, options);
+                if (tab != null)
+                    mDoorHangerPopup.addDoorHanger(message, value, buttons, tab, options);
             }
         });
     }
 
     void handleDoorHangerRemove(JSONObject geckoObject) throws JSONException {
         final String value = geckoObject.getString("value");
         final int tabId = geckoObject.getInt("tabID");