Bug 578150: Protect against the docshell loosing its document before we've had time to notify on it. r=mrbkap

This commit is contained in:
Jonas Sicking 2010-07-12 14:50:07 -07:00
parent 093feb20dd
commit 24dea5b72b

View File

@ -2163,6 +2163,10 @@ nsGlobalWindow::SetNewDocument(nsIDocument* aDocument,
void
nsGlobalWindow::DispatchDOMWindowCreated()
{
if (!mDoc || !mDocument) {
return;
}
// Fire DOMWindowCreated at chrome event listeners
nsContentUtils::DispatchChromeEvent(mDoc, mDocument, NS_LITERAL_STRING("DOMWindowCreated"),
PR_TRUE /* bubbles */,