diff --git a/mozilla/xpfe/appshell/src/nsContentTreeOwner.cpp b/mozilla/xpfe/appshell/src/nsContentTreeOwner.cpp index ba88c1209d2..8cd4e92fd90 100644 --- a/mozilla/xpfe/appshell/src/nsContentTreeOwner.cpp +++ b/mozilla/xpfe/appshell/src/nsContentTreeOwner.cpp @@ -255,7 +255,7 @@ NS_IMETHODIMP nsContentTreeOwner::FindItemWithName(const PRUnichar* aName, if (win) { PRInt32 count = win->mTargetableShells.Count(); PRInt32 i; - for (i = 0; i < count; ++i) { + for (i = 0; i < count && !*aFoundItem; ++i) { nsCOMPtr shellAsTreeItem = do_QueryReferent(win->mTargetableShells[i]); if (shellAsTreeItem) {