Bug 1146883 - Null check the node passed to GetGoodSelPointForNode. r=smaug, a=lmandel
authorEhsan Akhgari <ehsan@mozilla.com>
Tue, 24 Mar 2015 11:35:37 -0400
changeset 252107 8fda35675a3fc2f66dca80efe146cf7200dfdb8b
parent 252106 e35deaa85d2172cbc0de0b594d1de7d59efb5dc4
child 252108 7ec23d08cf323dddd894142b87cce0eabc65685b
child 252112 6042fc978a7f730dd2b7f34473127edb3f1c3804
child 252149 8796bdbd1bc0266d47c798d0d8b50edab6774b4c
push id701
push userryanvm@gmail.com
push dateWed, 25 Mar 2015 00:23:04 +0000
treeherdermozilla-release@7ec23d08cf32 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssmaug, lmandel
bugs1146883
milestone37.0
Bug 1146883 - Null check the node passed to GetGoodSelPointForNode. r=smaug, a=lmandel CLOSED TREE
editor/libeditor/nsHTMLEditRules.cpp
--- a/editor/libeditor/nsHTMLEditRules.cpp
+++ b/editor/libeditor/nsHTMLEditRules.cpp
@@ -2221,16 +2221,17 @@ nsHTMLEditRules::WillDeleteSelection(Sel
       // Don't cross table boundaries
       if (leftNode && rightNode &&
           InDifferentTableElements(leftNode, rightNode)) {
         return NS_OK;
       }
 
       if (bDeletedBR) {
         // Put selection at edge of block and we are done.
+        NS_ENSURE_STATE(leafNode);
         ::DOMPoint newSel = GetGoodSelPointForNode(*leafNode, aAction);
         NS_ENSURE_STATE(newSel.node);
         aSelection->Collapse(newSel.node, newSel.offset);
         return NS_OK;
       }
 
       // Else we are joining content to block