137815 - crash hitting enter key before panel content finishes loading [@nsTreeSelection::FireOnSelectHandler]. r=bryner sr=ben

This commit is contained in:
blakeross%telocity.com 2002-04-28 23:55:58 +00:00
Родитель 04d22d91a0
Коммит 2999458f3a
1 изменённых файлов: 6 добавлений и 1 удалений

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

@ -717,7 +717,12 @@ nsTreeSelection::FireOnSelectHandler()
nsCOMPtr<nsIContent> content(do_QueryInterface(elt));
nsCOMPtr<nsIDocument> document;
content->GetDocument(*getter_AddRefs(document));
// we might be firing on a delay, so it's possible in rare cases that
// the document may have been destroyed by the time it fires
if (!document)
return NS_OK;
PRInt32 count = document->GetNumberOfShells();
for (PRInt32 i = 0; i < count; i++) {
nsCOMPtr<nsIPresShell> shell;