Title: [111726] trunk/Source/WebKit/blackberry
Revision
111726
Author
[email protected]
Date
2012-03-22 10:38:36 -0700 (Thu, 22 Mar 2012)

Log Message

[BlackBerry] DOMSupport isPositionInNode should have early returns for null nodes
https://bugs.webkit.org/show_bug.cgi?id=81929

Reviewed by Rob Buis.

Add early returns in isPositionInNode when either
node or the position node is null.

* WebKitSupport/DOMSupport.cpp:
(BlackBerry::WebKit::DOMSupport::isPositionInNode):

Modified Paths

Diff

Modified: trunk/Source/WebKit/blackberry/ChangeLog (111725 => 111726)


--- trunk/Source/WebKit/blackberry/ChangeLog	2012-03-22 17:28:06 UTC (rev 111725)
+++ trunk/Source/WebKit/blackberry/ChangeLog	2012-03-22 17:38:36 UTC (rev 111726)
@@ -1,3 +1,16 @@
+2012-03-22  Mike Fenton  <[email protected]>
+
+        [BlackBerry] DOMSupport isPositionInNode should have early returns for null nodes
+        https://bugs.webkit.org/show_bug.cgi?id=81929
+
+        Reviewed by Rob Buis.
+
+        Add early returns in isPositionInNode when either
+        node or the position node is null.
+
+        * WebKitSupport/DOMSupport.cpp:
+        (BlackBerry::WebKit::DOMSupport::isPositionInNode):
+
 2012-03-21  Jonathan Dong  <[email protected]>
 
         [BlackBerry] Credential save and autofill implemetation

Modified: trunk/Source/WebKit/blackberry/WebKitSupport/DOMSupport.cpp (111725 => 111726)


--- trunk/Source/WebKit/blackberry/WebKitSupport/DOMSupport.cpp	2012-03-22 17:28:06 UTC (rev 111725)
+++ trunk/Source/WebKit/blackberry/WebKitSupport/DOMSupport.cpp	2012-03-22 17:38:36 UTC (rev 111726)
@@ -293,8 +293,14 @@
 
 bool isPositionInNode(Node* node, const Position& position)
 {
+    if (!node)
+        return false;
+
     int offset = 0;
     Node* domNodeAtPos = DOMContainerNodeForPosition(position);
+    if (!domNodeAtPos)
+        return false;
+
     if (domNodeAtPos == position.containerNode())
         offset = position.computeOffsetInContainerNode();
 
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to