diff --git a/mozilla/docshell/base/nsDocShell.cpp b/mozilla/docshell/base/nsDocShell.cpp index be2a63ea671..6cacf5821bf 100644 --- a/mozilla/docshell/base/nsDocShell.cpp +++ b/mozilla/docshell/base/nsDocShell.cpp @@ -1971,6 +1971,9 @@ nsDocShell::FindItemWithName(const PRUnichar * aName, // If we don't find one, we return NS_OK and a null result *_retval = nsnull; + if (!*aName) + return NS_OK; + if (!aRequestor) { nsCOMPtr foundItem; @@ -1980,7 +1983,7 @@ nsDocShell::FindItemWithName(const PRUnichar * aName, // for a null aRequestor. nsDependentString name(aName); - if (name.IsEmpty() || name.LowerCaseEqualsLiteral("_self")) { + if (name.LowerCaseEqualsLiteral("_self")) { foundItem = this; } else if (name.LowerCaseEqualsLiteral("_blank") || @@ -2424,6 +2427,9 @@ nsDocShell::FindChildWithName(const PRUnichar * aName, *_retval = nsnull; // if we don't find one, we return NS_OK and a null result + if (!*aName) + return NS_OK; + nsXPIDLString childName; PRInt32 i, n = mChildList.Count(); for (i = 0; i < n; i++) {