Bug 950334 - Australis' (un)registerWindow methods in BrowserUITelemetry assume areaNode exists, r=mconley
authorGijs Kruitbosch <gijskruitbosch@gmail.com>
Mon, 16 Dec 2013 11:28:38 +0000
changeset 160650 5519cf3ac8f66bc1e65b263d90bdbccf12c2b66b
parent 160649 08e0383e7428134d6b104d4250872ec07ce89f71
child 160651 fcb3b07e715475c65f624ffa403d717b38a5395b
child 160705 81dd3e01279a656ad0bf19b003da6c467e26b9e4
push id25843
push userryanvm@gmail.com
push dateMon, 16 Dec 2013 21:54:22 +0000
treeherdermozilla-central@fcb3b07e7154 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmconley
bugs950334
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 950334 - Australis' (un)registerWindow methods in BrowserUITelemetry assume areaNode exists, r=mconley
browser/modules/BrowserUITelemetry.jsm
--- a/browser/modules/BrowserUITelemetry.jsm
+++ b/browser/modules/BrowserUITelemetry.jsm
@@ -97,27 +97,31 @@ this.BrowserUITelemetry = {
   },
 
   _registerWindow: function(aWindow) {
     aWindow.addEventListener("unload", this);
     let document = aWindow.document;
 
     for (let areaID of CustomizableUI.areas) {
       let areaNode = document.getElementById(areaID);
-      (areaNode.customizationTarget || areaNode).addEventListener("mouseup", this);
+      if (areaNode) {
+        (areaNode.customizationTarget || areaNode).addEventListener("mouseup", this);
+      }
     }
   },
 
   _unregisterWindow: function(aWindow) {
     aWindow.removeEventListener("unload", this);
     let document = aWindow.document;
 
     for (let areaID of CustomizableUI.areas) {
       let areaNode = document.getElementById(areaID);
-      (areaNode.customizationTarget || areaNode).removeEventListener("mouseup", this);
+      if (areaNode) {
+        (areaNode.customizationTarget || areaNode).removeEventListener("mouseup", this);
+      }
     }
   },
 
   handleEvent: function(aEvent) {
     switch(aEvent.type) {
       case "unload":
         this._unregisterWindow(aEvent.currentTarget);
         break;