null-check mDocument in case firing onload causes it to go away (bug 298022). r=darin, a=asa.

This commit is contained in:
bryner%brianryner.com 2005-06-17 21:49:01 +00:00
parent 98a9a84fcb
commit d0503004d6

View File

@ -1029,8 +1029,10 @@ DocumentViewerImpl::LoadComplete(nsresult aStatus)
}
// Notify the document that it has been shown (regardless of whether
// it was just loaded).
mDocument->OnPageShow(restoring);
// it was just loaded). Note: mDocument may be null now if the above
// firing of onload caused the document to unload.
if (mDocument)
mDocument->OnPageShow(restoring);
// Now that the document has loaded, we can tell the presshell
// to unsuppress painting.