Fixes a null exception when hovering in some areas of the DOM tree.
authortimothy@apple.com <timothy@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 4 Apr 2008 20:13:34 +0000 (20:13 +0000)
committertimothy@apple.com <timothy@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 4 Apr 2008 20:13:34 +0000 (20:13 +0000)
Reviewed by Adam Roben.

* page/inspector/treeoutline.js:
(TreeOutline.prototype.treeElementFromPoint): Check listNode for null/undefined
before accessing any properties. Return null if listNode is null.

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

WebCore/ChangeLog
WebCore/page/inspector/treeoutline.js

index fa43535..f912be0 100644 (file)
@@ -1,5 +1,15 @@
 2008-04-04  Timothy Hatcher  <timothy@apple.com>
 
+        Fixes a null exception when hovering in some areas of the DOM tree.
+
+        Reviewed by Adam Roben.
+
+        * page/inspector/treeoutline.js:
+        (TreeOutline.prototype.treeElementFromPoint): Check listNode for null/undefined
+        before accessing any properties. Return null if listNode is null.
+
+2008-04-04  Timothy Hatcher  <timothy@apple.com>
+
         Changing WebInspector.currentFocusElement to/from an input element
         does not change the actual focus of that input element. You see this
         in the search field.
index b025890..44dc4d3 100644 (file)
@@ -289,7 +289,9 @@ TreeOutline.prototype.treeElementFromPoint = function(x, y)
 {
     var node = this._childrenListNode.ownerDocument.elementFromPoint(x, y);
     var listNode = node.enclosingNodeOrSelfWithNodeNameInArray(["ol", "li"]);
-    return listNode.parentTreeElement || listNode.treeElement;
+    if (listNode)
+        return listNode.parentTreeElement || listNode.treeElement;
+    return null;
 }
 
 TreeOutline.prototype.handleKeyEvent = function(event)