bug 322773: The prompt service asserts if there our window doesn't have a document. r+sr=bzbarsky

git-svn-id: svn://10.0.0.236/trunk@187783 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
mrbkap%gmail.com
2006-01-18 23:06:06 +00:00
parent 0b387d0adf
commit 0d50ed8549
2 changed files with 14 additions and 1 deletions

View File

@@ -3095,6 +3095,15 @@ nsDocShell::DisplayLoadError(nsresult aError, nsIURI *aURI,
}
else
{
// The prompter reqires that our private window has a document (or it
// asserts). Satisfy that assertion now since GetDocument will force
// creation of one if it hasn't already been created.
nsCOMPtr<nsPIDOMWindow> pwin(do_QueryInterface(mScriptGlobal));
if (pwin) {
nsCOMPtr<nsIDOMDocument> doc;
pwin->GetDocument(getter_AddRefs(doc));
}
// Display a message box
prompter->Alert(nsnull, messageStr.get());
}