commit 2e9ce146b6b5 Author: Shane Caraveo Date: Fri Oct 6 16:58:15 2017 -0700 Bug 1406229 - Fix autocomplete crash in panels when window is closed during event. r=mak, a=ritu MozReview-Commit-ID: 6TrLuwrk2nD --HG-- extra : source : 118b67c940dc554a4adf6fb397db775861962c68 --- toolkit/components/autocomplete/nsAutoCompleteController.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git toolkit/components/autocomplete/nsAutoCompleteController.cpp toolkit/components/autocomplete/nsAutoCompleteController.cpp index 3876380201f6..ba5287f1fabd 100644 --- toolkit/components/autocomplete/nsAutoCompleteController.cpp +++ toolkit/components/autocomplete/nsAutoCompleteController.cpp @@ -367,6 +367,13 @@ nsAutoCompleteController::HandleEnter(bool aIsPopupSelection, // 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;