Bug 1406229 fix autocomplete crash in panels when window is closed during event, r?mak
MozReview-Commit-ID: 6TrLuwrk2nD
--- a/toolkit/components/autocomplete/nsAutoCompleteController.cpp
+++ b/toolkit/components/autocomplete/nsAutoCompleteController.cpp
@@ -362,16 +362,23 @@ nsAutoCompleteController::HandleEnter(bo
int32_t selectedIndex;
popup->GetSelectedIndex(&selectedIndex);
*_retval = selectedIndex >= 0;
}
}
// Stop the search, and handle the enter.
StopSearch();
+ // StopSearch() can call PostSearchCleanup() which might result
+ // in a blur event, which could null out mInput, so we need to check it
+ // again. See bug #408463 for more details
+ if (!mInput) {
+ return NS_OK;
+ }
+
EnterMatch(aIsPopupSelection, aEvent);
return NS_OK;
}
NS_IMETHODIMP
nsAutoCompleteController::HandleEscape(bool *_retval)
{