Bug 1115055 EditorEventListener::MouseDown() should check if mEditorBase is nullptr before calling its ForceCompositionEnd() r=smaug a=jcristau
authorMasayuki Nakano <masayuki@d-toybox.com>
Mon, 30 Jan 2017 17:43:53 +0900
changeset 375774 4c4d63ac9997522d8e19fbcf3fcf5b34727481bc
parent 375773 005919b0717191c77f6a11b1d4facd659cb4368e
child 375775 c9d3429e9d3c95ef350fc2fe2bb3e0accc34a86b
push id6996
push userjlorenzo@mozilla.com
push dateMon, 06 Mar 2017 20:48:21 +0000
treeherdermozilla-beta@d89512dab048 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssmaug, jcristau
bugs1115055
milestone53.0a2
Bug 1115055 EditorEventListener::MouseDown() should check if mEditorBase is nullptr before calling its ForceCompositionEnd() r=smaug a=jcristau EditorEventListener::MouseDown() may be called by HTMLEditorEventListener::MouseDown() too. In this case, mEditorBase may be nullptr. Therefore, EditorEventListener::MouseDown() should check if mEditorBase is still available before using it. MozReview-Commit-ID: 1wAgPdt3db0
editor/libeditor/EditorEventListener.cpp
--- a/editor/libeditor/EditorEventListener.cpp
+++ b/editor/libeditor/EditorEventListener.cpp
@@ -760,17 +760,19 @@ EditorEventListener::NotifyIMEOfMouseBut
                                                      aMouseEvent);
 }
 
 nsresult
 EditorEventListener::MouseDown(nsIDOMMouseEvent* aMouseEvent)
 {
   // FYI: This may be called by HTMLEditorEventListener::MouseDown() even
   //      when the event is not acceptable for committing composition.
-  mEditorBase->ForceCompositionEnd();
+  if (mEditorBase) {
+    mEditorBase->ForceCompositionEnd();
+  }
   return NS_OK;
 }
 
 nsresult
 EditorEventListener::HandleText(nsIDOMEvent* aTextEvent)
 {
   if (!mEditorBase->IsAcceptableInputEvent(aTextEvent)) {
     return NS_OK;