Add null ptr checks to avoid crashing, this fixes #30372. r=av@netscape.com

This commit is contained in:
jst%netscape.com 2000-03-31 00:31:44 +00:00
parent efa5624e14
commit e85facb819

View File

@ -87,12 +87,16 @@ nsEvaluateStringProxy::Init(nsIChannel* channel)
NS_IMETHODIMP
nsEvaluateStringProxy::EvaluateString(char **aRetValue, PRBool *aIsUndefined)
{
NS_ENSURE_ARG_POINTER(mChannel);
NS_ENSURE_ARG_POINTER(aRetValue);
NS_ENSURE_ARG_POINTER(aIsUndefined);
nsresult rv;
NS_ENSURE_ARG_POINTER(mChannel);
nsCOMPtr<nsIInterfaceRequestor> callbacks;
rv = mChannel->GetNotificationCallbacks(getter_AddRefs(callbacks));
if (NS_FAILED(rv)) return rv;
NS_ENSURE_TRUE(callbacks, NS_ERROR_FAILURE);
// The event sink must be a script global Object Owner or we fail.
nsCOMPtr<nsIScriptGlobalObjectOwner> globalOwner;