Prevent nil dereference in debug code.
authorharrison <harrison@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 31 Jan 2005 20:12:49 +0000 (20:12 +0000)
committerharrison <harrison@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 31 Jan 2005 20:12:49 +0000 (20:12 +0000)
        * khtml/xml/dom_nodeimpl.cpp:
        (NodeImpl::displayTree):
        Stop when parent is 0, too.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@8485 268f45cc-cd09-0410-ab3c-d52691b4dbfc

WebCore/ChangeLog-2005-08-23
WebCore/khtml/xml/dom_nodeimpl.cpp

index 9ec6d76fc24c25aae824c6d8fa61391c589f5149..550a5634c3a4c5fcea806b226362169ae1e5b8bf 100644 (file)
@@ -1,3 +1,11 @@
+2005-01-31  David Harrison  <harrison@apple.com>
+
+        Prevent nil dereference in debug code.
+
+        * khtml/xml/dom_nodeimpl.cpp:
+        (NodeImpl::displayTree):
+        Stop when parent is 0, too.
+
 2005-01-31  John Sullivan  <sullivan@apple.com>
 
         Reviewed by Dave Hyatt.
index 1302442ba8f2c32d99b176bfbfea47868b6c76bb..a9556535f8fd166e4c9be55d5589233ee618c071 100644 (file)
@@ -1407,7 +1407,7 @@ void NodeImpl::displayTree()
         NodeImpl *tmpNode;
         if (node == this)
             fprintf(stderr, "*");
-        for (tmpNode = node; tmpNode != rootNode; tmpNode = tmpNode->parentNode())
+        for (tmpNode = node; tmpNode && tmpNode != rootNode; tmpNode = tmpNode->parentNode())
             fprintf(stderr, "\t");
         node->displayNode(0);
     }