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
authorEhsan Akhgari <ehsan@mozilla.com>
Thu, 21 May 2015 16:16:36 -0400
changeset 277739 6d79c472fe572e6f9ff202969ceffce5ab29d825
parent 277738 13b7d0d6301a942e70b36f2e5f272ac3b2b5a978
child 277740 cfc6bf3429036f1fb4bfa08e9b09b1d034c13702
push id897
push userjlund@mozilla.com
push dateMon, 14 Sep 2015 18:56:12 +0000
treeherdermozilla-release@9411e2d2b214 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersroc
bugs1166932
milestone41.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
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
dom/html/nsTextEditorState.cpp
--- a/dom/html/nsTextEditorState.cpp
+++ b/dom/html/nsTextEditorState.cpp
@@ -925,16 +925,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
   //