Fix uncaught exception seen in Inspector.
authorjoepeck@webkit.org <joepeck@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 9 Apr 2015 01:37:52 +0000 (01:37 +0000)
committerjoepeck@webkit.org <joepeck@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 9 Apr 2015 01:37:52 +0000 (01:37 +0000)
Reviewed by Timothy Hatcher.

* UserInterface/Views/TreeOutline.js:
(WebInspector.TreeOutline.prototype.removeChild):
Add a null check. Everywhere else null checks this member variable
which may not exist yet, this case was missing the check.

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

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

index 9418f869586bbc037840077620dee65ab96fb790..45de5cd361058ed409dbe45c196fba76e2f9716d 100644 (file)
@@ -1,3 +1,14 @@
+2015-04-08  Joseph Pecoraro  <pecoraro@apple.com>
+
+        Fix uncaught exception seen in Inspector.
+
+        Reviewed by Timothy Hatcher.
+
+        * UserInterface/Views/TreeOutline.js:
+        (WebInspector.TreeOutline.prototype.removeChild):
+        Add a null check. Everywhere else null checks this member variable
+        which may not exist yet, this case was missing the check.
+
 2015-04-08  Tobias Reiss  <tobi+webkit@basecode.de>
 
         Web Inspector: Regression: Showing of color swatches no longer works in Details Sidebar
index 2c0f9de9ece83f2bda489fd0b687837dfd0d8dc6..d9f546347005461cc6db3fb8ff70db0b3b7c457b 100644 (file)
@@ -195,7 +195,8 @@ WebInspector.TreeOutline = class TreeOutline extends WebInspector.Object
         this.removeChildAtIndex(childIndex, suppressOnDeselect, suppressSelectSibling);
 
         if (!this.children.length) {
-            this._listItemNode.classList.remove("parent");
+            if (this._listItemNode)
+                this._listItemNode.classList.remove("parent");
             this.hasChildren = false;
         }
     }