Fixing bug 86191. Don't return nsnull as a nsresult, return NS_OK in stead. r=sicking@bigfoot.com, sr=nobody, trivial change.

This commit is contained in:
jst%netscape.com 2002-01-06 02:39:13 +00:00
parent e1db4e7f60
commit b74c53591a

View File

@ -135,13 +135,16 @@ nsresult
nsContentUtils::GetDynamicScriptContext(JSContext *aContext,
nsIScriptContext** aScriptContext)
{
*aScriptContext = nsnull;
// XXX We rely on the rule that if any JSContext in our JSRuntime has a
// private set then that private *must* be a pointer to an nsISupports.
nsISupports *supports = (nsIScriptContext*) JS_GetContextPrivate(aContext);
if (!supports)
return nsnull;
return supports->QueryInterface(NS_GET_IID(nsIScriptContext),
(void**)aScriptContext);
nsISupports *supports = (nsIScriptContext*)JS_GetContextPrivate(aContext);
if (!supports) {
return NS_OK;
}
return CallQueryInterface(supports, aScriptContext);
}
template <class OutputIterator>