From 8f98ca93c9630f3ceb85638126ae8cec2e61d94f Mon Sep 17 00:00:00 2001 From: "sspitzer@mozilla.org" Date: Wed, 19 Sep 2007 14:16:34 -0700 Subject: [PATCH] fix for top crasher bug #395344: Topcrash typing in the address bar / search box [@ nsAutoCompleteController::HandleText] r=gavin --- .../autocomplete/src/nsAutoCompleteController.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/toolkit/components/autocomplete/src/nsAutoCompleteController.cpp b/toolkit/components/autocomplete/src/nsAutoCompleteController.cpp index ac87369aa5c..a1836ae5328 100644 --- a/toolkit/components/autocomplete/src/nsAutoCompleteController.cpp +++ b/toolkit/components/autocomplete/src/nsAutoCompleteController.cpp @@ -221,6 +221,13 @@ nsAutoCompleteController::HandleText(PRBool aIgnoreSelection) // Stop all searches in case they are async. StopSearch(); + if (!mInput) { + // 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 #395344 for more details + return NS_OK; + } + PRBool disabled; mInput->GetDisableAutoComplete(&disabled); NS_ENSURE_TRUE(!disabled, NS_OK);