Bug 1166932 - Part 2: Make sure that nsTextInputListener doesn't try to perform edit actions if it has been disconnected from the editor object. r=roc, a=abillings
authorEhsan Akhgari <ehsan@mozilla.com>
Thu, 21 May 2015 16:16:36 -0400
changeset 274727 1642ba0f72b4a14b27f8079d64b82e3501192efe
parent 274726 60418e3204f8004e658bc412e689bb6782d6b5d8
child 274728 872a53f0dbae0df9fbd56a11b536891c6d9b720e
push id863
push userraliiev@mozilla.com
push dateMon, 03 Aug 2015 13:22:43 +0000
treeherdermozilla-release@f6321b14228d [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersroc, abillings
bugs1166932
milestone40.0a2
Bug 1166932 - Part 2: Make sure that nsTextInputListener doesn't try to perform edit actions if it has been disconnected from the editor object. r=roc, a=abillings
dom/html/nsTextEditorState.cpp
--- a/dom/html/nsTextEditorState.cpp
+++ b/dom/html/nsTextEditorState.cpp
@@ -892,16 +892,22 @@ nsTextInputListener::HandleEvent(nsIDOME
   return NS_OK;
 }
 
 // BEGIN nsIEditorObserver
 
 NS_IMETHODIMP
 nsTextInputListener::EditAction()
 {
+  if (!mFrame) {
+    // We've been disconnected from the nsTextEditorState object, nothing to do
+    // here.
+    return NS_OK;
+  }
+
   nsWeakFrame weakFrame = mFrame;
 
   nsITextControlFrame* frameBase = do_QueryFrame(mFrame);
   nsTextControlFrame* frame = static_cast<nsTextControlFrame*> (frameBase);
   NS_ASSERTION(frame, "Where is our frame?");
   //
   // Update the undo / redo menus
   //