Bug 679626 crash in nsIDOMWindowInternal::GetDocShell with signature pointing to nsASDOMWindowEnumerator::GetNext - try to avoid windows with no docshells. r=bz

This commit is contained in:
David Bienvenu 2012-10-02 09:06:53 +01:00
parent c1ed6de18a
commit a12f3dbf3f

View File

@ -222,11 +222,12 @@ NS_IMETHODIMP nsASDOMWindowEnumerator::GetNext(nsISupports **retval)
return NS_ERROR_INVALID_ARG;
*retval = nullptr;
if (mCurrentPosition) {
while (mCurrentPosition) {
nsCOMPtr<nsIDOMWindow> domWindow;
GetDOMWindow(mCurrentPosition->mWindow, domWindow);
CallQueryInterface(domWindow, retval);
mCurrentPosition = FindNext();
if (domWindow)
return CallQueryInterface(domWindow, retval);
}
return NS_OK;
}