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
Родитель 98a9a84fcb
Коммит d0503004d6
1 изменённых файлов: 4 добавлений и 2 удалений

Просмотреть файл

@ -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.