Bug 499295 NULL crash [@ nsPluginInstancePeerImpl::GetJSContext]
authortimeless@mozdev.org
Sat, 27 Jun 2009 18:42:51 -0700
changeset 29779 a4b3c7bb2fb0
parent 29778 6e7a81c55a15
child 29780 6cf5544090bc
push id106
push userhsivonen@iki.fi
push dateSun, 28 Jun 2009 17:44:42 +0000
bugs499295
milestone1.9.2a1pre
Bug 499295 NULL crash [@ nsPluginInstancePeerImpl::GetJSContext] r=jst sr=jst
modules/plugin/base/src/nsPluginInstancePeer.cpp
--- a/modules/plugin/base/src/nsPluginInstancePeer.cpp
+++ b/modules/plugin/base/src/nsPluginInstancePeer.cpp
@@ -684,18 +684,20 @@ nsPluginInstancePeerImpl::GetJSThread(PR
 	return NS_OK;
 }
 
 NS_IMETHODIMP
 nsPluginInstancePeerImpl::GetJSContext(JSContext* *outContext)
 {
   *outContext = NULL;
   nsresult rv = NS_ERROR_FAILURE;
+  if (!mOwner)
+    return rv;
+
   nsCOMPtr<nsIDocument> document;
-
   rv = mOwner->GetDocument(getter_AddRefs(document));
 
   if (NS_SUCCEEDED(rv) && document) {
     nsIScriptGlobalObject *global = document->GetScriptGlobalObject();
 
     if (global) {
       nsIScriptContext *context = global->GetContext();