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