Bug 1058033 - Fix 'window is null' error on toolbox open in paintflashing.js. r=harth
authorBrian Grinstead <bgrinstead@mozilla.com>
Tue, 26 Aug 2014 13:43:00 -0400
changeset 223427 76cce82c11164e34b98430ae5297b03a47b8369b
parent 223426 d7a9e478db1d726bfb97ba4f8e69a4604f975cb8
child 223428 cad3710aa5228df8b1bba6a9d0832a7074a27187
push id3979
push userraliiev@mozilla.com
push dateMon, 13 Oct 2014 16:35:44 +0000
treeherdermozilla-beta@30f2cc610691 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersharth
bugs1058033
milestone34.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 1058033 - Fix 'window is null' error on toolbox open in paintflashing.js. r=harth
toolkit/devtools/gcli/commands/paintflashing.js
--- a/toolkit/devtools/gcli/commands/paintflashing.js
+++ b/toolkit/devtools/gcli/commands/paintflashing.js
@@ -97,20 +97,24 @@ exports.items = [
   {
     name: "paintflashing toggle",
     hidden: true,
     buttonId: "command-button-paintflashing",
     buttonClass: "command-button command-button-invertable",
     state: {
       isChecked: function(aTarget) {
         if (aTarget.isLocalTab) {
+          let isChecked = false;
           let window = aTarget.tab.linkedBrowser.contentWindow;
-          let wUtils = window.QueryInterface(Ci.nsIInterfaceRequestor).
-                              getInterface(Ci.nsIDOMWindowUtils);
-          return wUtils.paintFlashing;
+          if (window) {
+            let wUtils = window.QueryInterface(Ci.nsIInterfaceRequestor).
+                                getInterface(Ci.nsIDOMWindowUtils);
+            isChecked = wUtils.paintFlashing;
+          }
+          return isChecked;
         } else {
           throw new Error("Unsupported target");
         }
       },
       onChange: function(aTarget, aChangeHandler) {
         eventEmitter.on("changed", aChangeHandler);
       },
       offChange: function(aTarget, aChangeHandler) {