diff --git a/dom/base/nsGlobalWindow.cpp b/dom/base/nsGlobalWindow.cpp index 23fee574050..34ed266ac31 100644 --- a/dom/base/nsGlobalWindow.cpp +++ b/dom/base/nsGlobalWindow.cpp @@ -8077,7 +8077,10 @@ void nsGlobalWindow::ClearWindowScope(nsISupports *aWindow) { nsCOMPtr sgo(do_QueryInterface(aWindow)); - sgo->GetContext()->ClearScope(sgo->GetGlobalJSObject(), PR_TRUE); + nsIScriptContext *scx = sgo->GetContext(); + if (scx) { + scx->ClearScope(sgo->GetGlobalJSObject(), PR_TRUE); + } } //*****************************************************************************