Bug 602514 [@ AutoGCRooter::AutoGCRooter] if !ccx.IsValid() in nsXPCWrappedJSClass::CallMethod

r=mrbkap
This commit is contained in:
timeless@mozdev.org 2011-03-28 17:26:33 -04:00
parent 52bd717d9f
commit b38bcb6ae4

View File

@ -1298,16 +1298,11 @@ nsXPCWrappedJSClass::CallMethod(nsXPCWrappedJS* wrapper, uint16 methodIndex,
// to our real callee.
JSContext *context = GetContextFromObject(wrapper->GetJSObject());
XPCCallContext ccx(NATIVE_CALLER, context);
if(ccx.IsValid())
{
xpcc = ccx.GetXPCContext();
cx = ccx.GetJSContext();
}
else
{
xpcc = nsnull;
cx = nsnull;
}
if(!ccx.IsValid())
return retval;
xpcc = ccx.GetXPCContext();
cx = ccx.GetJSContext();
if(!cx || !xpcc || !IsReflectable(methodIndex))
return NS_ERROR_FAILURE;