Bug 813801: null-check blocklistWindow in nsBlocklistService.js. r=dtownsend
authorChen Zeyu <zeyufly@gmail.com>
Wed, 05 Dec 2012 14:13:26 -0800
changeset 115123 c615b961c7b456d8bdfe1f3773f80a77d50aa3c5
parent 115122 a5ce402cd9113b52a4aca5f6c2222f5cc78cb9fc
child 115124 77f529436f2b3779ee1071b65f4c8d900f20cb22
push id23973
push useremorley@mozilla.com
push dateThu, 06 Dec 2012 10:04:18 +0000
treeherdermozilla-central@ddda5400c826 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersdtownsend
bugs813801
milestone20.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 813801: null-check blocklistWindow in nsBlocklistService.js. r=dtownsend
toolkit/mozapps/extensions/nsBlocklistService.js
--- a/toolkit/mozapps/extensions/nsBlocklistService.js
+++ b/toolkit/mozapps/extensions/nsBlocklistService.js
@@ -1033,17 +1033,18 @@ Blocklist.prototype = {
         if (event.target.location == URI_BLOCKLIST_DIALOG) {
           applyBlocklistChanges();
           blocklistWindow.removeEventListener("unload", blocklistUnloadHandler);
         }
       }
 
       let blocklistWindow = Services.ww.openWindow(null, URI_BLOCKLIST_DIALOG, "",
                               "chrome,centerscreen,dialog,titlebar", args);
-      blocklistWindow.addEventListener("unload", blocklistUnloadHandler, false);
+      if (blocklistWindow)
+        blocklistWindow.addEventListener("unload", blocklistUnloadHandler, false);
     });
   },
 
   classID: Components.ID("{66354bc9-7ed1-4692-ae1d-8da97d6b205e}"),
   QueryInterface: XPCOMUtils.generateQI([Ci.nsIObserver,
                                          Ci.nsIBlocklistService,
                                          Ci.nsITimerCallback]),
 };