Flipped the if. Was not continuing on success.

This commit is contained in:
tbogard%aol.net 1999-12-03 21:11:30 +00:00
parent 139d5cb27f
commit 9e5b4606dd
2 changed files with 5 additions and 3 deletions

View File

@ -116,12 +116,14 @@ nsDOMWindowList::NamedItem(const nsString& aName, nsIDOMWindow** aReturn)
mWebShell->FindChildWithName(aName.GetUnicode(), *getter_AddRefs(item));
nsCOMPtr<nsIScriptGlobalObject> globalObject(do_GetInterface(item));
if (NS_WARN_IF_FALSE(globalObject, "Couldn't get to the globalObject")) {
*aReturn = nsnull;
NS_ASSERTION(globalObject != nsnull, "Couldn't get to the globalObject");
if (globalObject) {
CallQueryInterface(globalObject.get(), aReturn);
}
else {
*aReturn = nsnull;
CallQueryInterface(globalObject.get(), aReturn);
}
return NS_OK;
}

View File

@ -116,10 +116,10 @@ nsFrameList::NamedItem(const nsString& aName, nsIDOMWindow** aReturn)
nsCOMPtr<nsIScriptGlobalObject> globalObject(do_GetInterface(item));
if (NS_WARN_IF_FALSE(globalObject, "Couldn't get to the globalObject")) {
CallQueryInterface(globalObject.get(), aReturn);
*aReturn = nsnull;
}
else {
*aReturn = nsnull;
CallQueryInterface(globalObject.get(), aReturn);
}
return NS_OK;
}