Check against null vp passed in to CallWrappedMethod. This fixes stuff in the xpcom/sample directory.

This commit is contained in:
mccabe%netscape.com 1999-05-13 03:34:54 +00:00
parent f077082e79
commit 96b21befe2

View File

@ -396,7 +396,8 @@ nsXPCWrappedNativeClass::CallWrappedMethod(JSContext* cx,
uintN err;
XPCContext* xpcc = nsXPConnect::GetContext(cx);
*vp = JSVAL_NULL;
if (vp)
*vp = JSVAL_NULL;
if(!xpcc)
goto done;
@ -588,8 +589,11 @@ nsXPCWrappedNativeClass::CallWrappedMethod(JSContext* cx,
goto done;
}
if(param.IsRetval())
if(param.IsRetval()) {
// Shouldn't happen?
NS_ASSERTION(vp, "CallWrappedMethod called with null vp for param.IsRetval() case");
*vp = v;
}
else
{
// we actually assured this before doing the invoke