diff --git a/toolkit/content/widgets/preferences.xml b/toolkit/content/widgets/preferences.xml index 489e64ea951..cb02e88653b 100644 --- a/toolkit/content/widgets/preferences.xml +++ b/toolkit/content/widgets/preferences.xml @@ -88,7 +88,8 @@ // In non-instant apply mode, we must try and use the last saved state // from any previous opens of a child dialog instead of the value from // preferences, to pick up any edits a user may have made. - if (document.documentElement.type == "child" && !this.instantApply) { + if (document.documentElement.type == "child" && + !this.instantApply && window.opener) { var pdoc = window.opener.document; var lastStatePref = pdoc.getElementById(window.location.href + "#" + this.id); this._setValue(lastStatePref ? lastStatePref.value @@ -758,7 +759,7 @@ if (!this._fireEvent("beforeaccept", this)) return; - if (this.type == "child") { + if (this.type == "child" && window.opener) { var psvc = Components.classes["@mozilla.org/preferences-service;1"] .getService(Components.interfaces.nsIPrefBranch); var instantApply = psvc.getBoolPref("browser.preferences.instantApply");