Bug 1058033 - Fix 'window is null' error on toolbox open in paintflashing.js. r=harth

This commit is contained in:
Brian Grinstead 2014-08-26 13:43:00 -04:00
parent 739ba46aad
commit 68f9edf635

View File

@ -102,10 +102,14 @@ exports.items = [
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");
}