Web Inspector: Uncaught Exception: null is not an object (evaluating 'this.selectedTr...
authordrousso@apple.com <drousso@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 15 Apr 2019 17:31:46 +0000 (17:31 +0000)
committerdrousso@apple.com <drousso@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 15 Apr 2019 17:31:46 +0000 (17:31 +0000)
https://bugs.webkit.org/show_bug.cgi?id=196804
<rdar://problem/49800708>

Reviewed by Timothy Hatcher.

* UserInterface/Views/DOMTreeOutline.js:
(WI.DOMTreeOutline.prototype.update):

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

Source/WebInspectorUI/ChangeLog
Source/WebInspectorUI/UserInterface/Views/DOMTreeOutline.js

index be41c75..d97e816 100644 (file)
@@ -1,5 +1,16 @@
 2019-04-15  Devin Rousso  <drousso@apple.com>
 
+        Web Inspector: Uncaught Exception: null is not an object (evaluating 'this.selectedTreeElement.reveal')
+        https://bugs.webkit.org/show_bug.cgi?id=196804
+        <rdar://problem/49800708>
+
+        Reviewed by Timothy Hatcher.
+
+        * UserInterface/Views/DOMTreeOutline.js:
+        (WI.DOMTreeOutline.prototype.update):
+
+2019-04-15  Devin Rousso  <drousso@apple.com>
+
         Web Inspector: Uncaught Exception: Can't find variable: WebGL2RenderingContext
         https://bugs.webkit.org/show_bug.cgi?id=196874
         <rdar://problem/49858912>
index 430fa76..4908ff2 100644 (file)
@@ -197,8 +197,16 @@ WI.DOMTreeOutline = class DOMTreeOutline extends WI.TreeOutline
             return treeElement;
         });
 
+        // It's possible that a previously selected node will no longer exist (e.g. after navigation).
+        selectedTreeElements = selectedTreeElements.filter((x) => !!x);
+
+        if (!selectedTreeElements.length)
+            return;
+
         this.selectTreeElements(selectedTreeElements);
-        this.selectedTreeElement.reveal();
+
+        if (this.selectedTreeElement)
+            this.selectedTreeElement.reveal();
     }
 
     updateSelectionArea()