Bug 5695. Check return code from GetScriptGlobalObject() before trying to deref pointer. r=nisheeth,a=chofmann

This commit is contained in:
waterson%netscape.com 1999-04-30 16:25:34 +00:00
parent 19ca513966
commit 79cb20e767

View File

@ -296,8 +296,8 @@ DocumentViewerImpl::Init(nsNativeWidget aNativeParent,
if (nsnull != owner) {
mDocument->SetScriptContextOwner(owner);
nsIScriptGlobalObject* global;
owner->GetScriptGlobalObject(&global);
if (nsnull != global) {
rv = owner->GetScriptGlobalObject(&global);
if (NS_SUCCEEDED(rv) && (nsnull != global)) {
nsIDOMDocument *domdoc = nsnull;
mDocument->QueryInterface(kIDOMDocumentIID,
(void**) &domdoc);