Bug 1218072 - crash in nsTextEditorState::FinishedRestoringSelection, r=smaug a=ritu
authorMark Capella <markcapella@twcny.rr.com>
Sat, 28 Nov 2015 11:44:54 -0500
changeset 305865 1889ec03ca127b05384add17b84085d2003dd3c9
parent 305862 c9f897c494c9aa7c6e6f4ca152b633c5caa88dd1
child 305866 1af2fbfc24a4370a252187c69f4d192dbcbd88e3
push id1001
push userraliiev@mozilla.com
push dateMon, 18 Jan 2016 19:06:03 +0000
treeherdermozilla-release@8b89261f3ac4 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssmaug, ritu
bugs1218072
milestone44.0
Bug 1218072 - crash in nsTextEditorState::FinishedRestoringSelection, r=smaug a=ritu
dom/html/nsTextEditorState.cpp
--- a/dom/html/nsTextEditorState.cpp
+++ b/dom/html/nsTextEditorState.cpp
@@ -105,17 +105,20 @@ public:
        mFrame->SetSelectionRange(properties.mStart,
                                  properties.mEnd,
                                  properties.mDirection);
       if (!mTextEditorState->mSelectionRestoreEagerInit) {
         mTextEditorState->HideSelectionIfBlurred();
       }
       mTextEditorState->mSelectionRestoreEagerInit = false;
     }
-    mTextEditorState->FinishedRestoringSelection();
+
+    if (mTextEditorState) {
+      mTextEditorState->FinishedRestoringSelection();
+    }
     return NS_OK;
   }
 
   // Let the text editor tell us we're no longer relevant - avoids use of nsWeakFrame
   void Revoke() {
     mFrame = nullptr;
     mTextEditorState = nullptr;
   }