Do something safe if this call fails

This commit is contained in:
jband%netscape.com 2000-04-25 04:50:49 +00:00
parent 6b04c3b5fa
commit 84c0a0901a

View File

@ -679,6 +679,9 @@ nsScriptSecurityManager::CanExecuteFunction(void *jsFuncObj,
JSContext *cx = GetCurrentContext();
if (!cx) {
cx = GetSafeContext();
if (!cx) {
return NS_ERROR_UNEXPECTED;
}
}
nsCOMPtr<nsIPrincipal> principal;
nsresult rv = GetFunctionObjectPrincipal(cx, (JSObject *) jsFuncObj,