From 6d4c6009189a01e423534c67c54e290652d07045 Mon Sep 17 00:00:00 2001 From: "timeless@mozdev.org" Date: Mon, 28 Mar 2011 17:26:33 -0400 Subject: [PATCH] Bug 602514 [@ AutoGCRooter::AutoGCRooter] if !ccx.IsValid() in nsXPCWrappedJSClass::CallMethod r=mrbkap --- js/src/xpconnect/src/xpcwrappedjsclass.cpp | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/js/src/xpconnect/src/xpcwrappedjsclass.cpp b/js/src/xpconnect/src/xpcwrappedjsclass.cpp index 3906478a007..a067120e761 100644 --- a/js/src/xpconnect/src/xpcwrappedjsclass.cpp +++ b/js/src/xpconnect/src/xpcwrappedjsclass.cpp @@ -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;