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
Родитель 72ad6e26bf
Коммит 70f4a36661
1 изменённых файлов: 5 добавлений и 1 удалений

Просмотреть файл

@ -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;