Bug 296526 - Crash if autocomplete list is open while a window navigation r=bryner

This commit is contained in:
bsmedberg%covad.net 2005-09-30 18:55:40 +00:00
parent 95c83cae7c
commit 36c96b2853

View File

@ -261,9 +261,12 @@ nsAutoCompleteController::HandleEnter(PRBool *_retval)
if (*_retval) {
nsCOMPtr<nsIAutoCompletePopup> popup;
mInput->GetPopup(getter_AddRefs(popup));
PRInt32 selectedIndex;
popup->GetSelectedIndex(&selectedIndex);
*_retval = selectedIndex >= 0;
if (popup) {
PRInt32 selectedIndex;
popup->GetSelectedIndex(&selectedIndex);
*_retval = selectedIndex >= 0;
}
}
ClearSearchTimer();