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
This commit is contained in:
waterson%netscape.com
1999-04-30 16:25:34 +00:00
parent 330b63434d
commit cb7bd86fbe

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);