When getting a TreeOwner that is null, make sure we don't crash trying to call QueryInterface on it when grabbing the nsIBaseWindow interface. r=saari

This commit is contained in:
tbogard%aol.net 2000-02-12 02:39:51 +00:00
Родитель 99594f57e8
Коммит 721c8092d1
1 изменённых файлов: 5 добавлений и 0 удалений

Просмотреть файл

@ -3247,6 +3247,11 @@ NS_IMETHODIMP GlobalWindowImpl::GetTreeOwner(nsIBaseWindow** aTreeOwner)
nsCOMPtr<nsIDocShellTreeOwner> treeOwner;
docShellAsItem->GetTreeOwner(getter_AddRefs(treeOwner));
if(!treeOwner)
{
*aTreeOwner = nsnull;
return NS_OK;
}
return CallQueryInterface(treeOwner, aTreeOwner);
}