Bug 887967 - avoid using a null nsIDOMWindowUtils when checking if a window is hidden. r=adw

--HG--
extra : rebase_source : 06c713242b8416839fe4e4a74188f49d014d92bf
This commit is contained in:
Mark Hammond 2013-06-27 17:22:44 -04:00
parent be28da3aca
commit e5741c94d3

View File

@ -377,7 +377,7 @@ function openModalWindow(domWin, uri, args) {
// a domWin was passed, so we can apply the check for it being hidden.
let winUtils = domWin.QueryInterface(Ci.nsIInterfaceRequestor)
.getInterface(Ci.nsIDOMWindowUtils);
if (!winUtils.isParentWindowMainWidgetVisible) {
if (winUtils && !winUtils.isParentWindowMainWidgetVisible) {
throw Components.Exception("Cannot call openModalWindow on a hidden window",
Cr.NS_ERROR_NOT_AVAILABLE);
}