Bug 1146883 - Null check the node passed to GetGoodSelPointForNode; r=smaug
authorEhsan Akhgari <ehsan@mozilla.com>
Tue, 24 Mar 2015 11:35:37 -0400
changeset 264279 a5cee922ae79418797a6e7f3ab19b0f9e19e85fe
parent 264237 828959dd93fbd97846d6ae4afb962d399413dabc
child 264280 6773b2f30d90ba25c0d29cff8375695e65bb3617
push id4718
push userraliiev@mozilla.com
push dateMon, 11 May 2015 18:39:53 +0000
treeherdermozilla-beta@c20c4ef55f08 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssmaug
bugs1146883
milestone39.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 1146883 - Null check the node passed to GetGoodSelPointForNode; r=smaug Landed on a CLOSED TREE so that we can uplift to Firefox 37 soon.
editor/libeditor/nsHTMLEditRules.cpp
--- a/editor/libeditor/nsHTMLEditRules.cpp
+++ b/editor/libeditor/nsHTMLEditRules.cpp
@@ -2222,16 +2222,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