Web Inspector: Uncaught Exception: undefined is not an object (evaluating 'classes...
authordrousso@apple.com <drousso@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 5 Feb 2019 07:48:10 +0000 (07:48 +0000)
committerdrousso@apple.com <drousso@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 5 Feb 2019 07:48:10 +0000 (07:48 +0000)
https://bugs.webkit.org/show_bug.cgi?id=194280
<rdar://problem/47811159>

Reviewed by Matt Baker.

* UserInterface/Views/GeneralStyleDetailsSidebarPanel.js:
(WI.GeneralStyleDetailsSidebarPanel.prototype._populateClassToggles):
Add a fallback value in case the `class` attribute isn't specified for the selected node.

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

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

index 630bec4..db9d66d 100644 (file)
@@ -1,5 +1,17 @@
 2019-02-04  Devin Rousso  <drousso@apple.com>
 
+        Web Inspector: Uncaught Exception: undefined is not an object (evaluating 'classes.includes')
+        https://bugs.webkit.org/show_bug.cgi?id=194280
+        <rdar://problem/47811159>
+
+        Reviewed by Matt Baker.
+
+        * UserInterface/Views/GeneralStyleDetailsSidebarPanel.js:
+        (WI.GeneralStyleDetailsSidebarPanel.prototype._populateClassToggles):
+        Add a fallback value in case the `class` attribute isn't specified for the selected node.
+
+2019-02-04  Devin Rousso  <drousso@apple.com>
+
         Web Inspector: Resources: missing resource data for document on reload
         https://bugs.webkit.org/show_bug.cgi?id=194243
         <rdar://problem/47559021>
index c73b0b9..d9b165e 100644 (file)
@@ -359,7 +359,7 @@ WI.GeneralStyleDetailsSidebarPanel = class GeneralStyleDetailsSidebarPanel exten
         while (this._classListContainer.children.length > 1)
             this._classListContainer.children[1].remove();
 
-        let classes = this.domNode.getAttribute("class");
+        let classes = this.domNode.getAttribute("class") || [];
         let classToggledMap = this.domNode[WI.GeneralStyleDetailsSidebarPanel.ToggledClassesSymbol];
         if (!classToggledMap)
             classToggledMap = this.domNode[WI.GeneralStyleDetailsSidebarPanel.ToggledClassesSymbol] = new Map;