Bug 598363 - Context menu cannot be dismissed (followup) [r=mfinkle]
authorMatt Brubeck <mbrubeck@mozilla.com>
Mon, 01 Nov 2010 16:58:56 -0700
changeset 66936 18b51bea520e261c73b93576b6f0c26ca693642c
parent 66935 b59a80b5a03330f3b00fdc6d877ef347ac25e863
child 66937 fd5f7f12a379015292ac556169fce64b790a7293
push id1
push userroot
push dateTue, 26 Apr 2011 22:38:44 +0000
treeherdermozilla-beta@bfdb6e623a36 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmfinkle
bugs598363
Bug 598363 - Context menu cannot be dismissed (followup) [r=mfinkle]
mobile/chrome/content/browser-ui.js
--- a/mobile/chrome/content/browser-ui.js
+++ b/mobile/chrome/content/browser-ui.js
@@ -338,17 +338,17 @@ var BrowserUI = {
   pushPopup: function pushPopup(aPanel, aElements) {
     this._hidePopup();
     this._popup =  { "panel": aPanel,
                      "elements": (aElements instanceof Array) ? aElements : [aElements] };
     this._dispatchPopupChanged(true);
   },
 
   popPopup: function popPopup(aPanel) {
-    if (aPanel != this._popup.panel)
+    if (!this._popup || aPanel != this._popup.panel)
       return;
     this._popup = null;
     this._dispatchPopupChanged(false);
   },
 
   _dispatchPopupChanged: function _dispatchPopupChanged(aVisible) {
     let stack = document.getElementById("stack");
     let event = document.createEvent("UIEvents");