Bug 964576 - fix target is null JS error in Australis' CustomizableUI, r=mikedeboer
authorGijs Kruitbosch <gijskruitbosch@gmail.com>
Tue, 28 Jan 2014 11:17:44 +0000
changeset 165560 4ff11d0219ccc1a108eb8512d6760001fde264f4
parent 165559 321d5443344db741b2dd325fa1241b187b426c8a
child 165561 a76a4f9219876a3eeded0989d3dddd0432cd6ac9
push id26097
push userryanvm@gmail.com
push dateTue, 28 Jan 2014 21:18:27 +0000
treeherdermozilla-central@128c86a925d7 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmikedeboer
bugs964576
milestone29.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 964576 - fix target is null JS error in Australis' CustomizableUI, r=mikedeboer
browser/components/customizableui/src/CustomizableUI.jsm
--- a/browser/components/customizableui/src/CustomizableUI.jsm
+++ b/browser/components/customizableui/src/CustomizableUI.jsm
@@ -1199,16 +1199,21 @@ let CustomizableUIInternal = {
         lastPopup = aNode.localName == "menupopup" ? aNode : lastPopup;
         aNode = aNode.parentNode;
       }
       return lastPopup;
     }
 
     let target = aEvent.originalTarget;
     let panel = this._getPanelForNode(aEvent.currentTarget);
+    // This can happen in e.g. customize mode. If there's no panel,
+    // there's clearly nothing for us to close; pretend we're interactive.
+    if (!panel) {
+      return true;
+    }
     // We keep track of:
     // whether we're in an input container (text field)
     let inInput = false;
     // whether we're in a popup/context menu
     let inMenu = false;
     // whether we're in a toolbarbutton/toolbaritem
     let inItem = false;
     // whether the current menuitem has a valid closemenu attribute