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 8fda35675a3f
parent 252106 e35deaa85d21
child 252108 7ec23d08cf32
child 252112 6042fc978a7f
child 252149 8796bdbd1bc0
push id701
push userryanvm@gmail.com
push date2015-03-25 00:23 +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