aboutsummaryrefslogtreecommitdiff
path: root/www/waterfox/files/patch-bug1406229
blob: defa506549977861825cabc8b66b6f2ed9be672c (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
commit 2e9ce146b6b5
Author: Shane Caraveo <scaraveo@mozilla.com>
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;