From cb7bd86fbe2e9b8e5aaf7a8f3e3ddde677ea7b0d Mon Sep 17 00:00:00 2001 From: "waterson%netscape.com" Date: Fri, 30 Apr 1999 16:25:34 +0000 Subject: [PATCH] Bug 5695. Check return code from GetScriptGlobalObject() before trying to deref pointer. r=nisheeth,a=chofmann git-svn-id: svn://10.0.0.236/trunk@29841 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/webshell/src/nsDocumentViewer.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mozilla/webshell/src/nsDocumentViewer.cpp b/mozilla/webshell/src/nsDocumentViewer.cpp index cd5a762f87f..8ed317a7929 100644 --- a/mozilla/webshell/src/nsDocumentViewer.cpp +++ b/mozilla/webshell/src/nsDocumentViewer.cpp @@ -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);