Uncaught Exception: content.isJSON is not a function selecting image resource
authorpecoraro@apple.com <pecoraro@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 13 Aug 2019 22:14:49 +0000 (22:14 +0000)
committerpecoraro@apple.com <pecoraro@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 13 Aug 2019 22:14:49 +0000 (22:14 +0000)
https://bugs.webkit.org/show_bug.cgi?id=200680

Reviewed by Devin Rousso.

* UserInterface/Views/ResourceClusterContentView.js:
(WI.ResourceClusterContentView.prototype._canUseJSONContentViewForContent):
Protect against non-string data, such as Blob response content.

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

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

index fa9d4b7..ed17534 100644 (file)
@@ -1,3 +1,14 @@
+2019-08-13  Joseph Pecoraro  <pecoraro@apple.com>
+
+        Uncaught Exception: content.isJSON is not a function selecting image resource
+        https://bugs.webkit.org/show_bug.cgi?id=200680
+
+        Reviewed by Devin Rousso.
+
+        * UserInterface/Views/ResourceClusterContentView.js:
+        (WI.ResourceClusterContentView.prototype._canUseJSONContentViewForContent):
+        Protect against non-string data, such as Blob response content.
+
 2019-08-13  Devin Rousso  <drousso@apple.com>
 
         Web Inspector: Styles: show @supports CSS groupings
index c1beacb..5582e03 100644 (file)
@@ -342,7 +342,7 @@ WI.ResourceClusterContentView = class ResourceClusterContentView extends WI.Clus
 
     _canUseJSONContentViewForContent(content)
     {
-        return content.isJSON((json) => json && (typeof json === "object" || Array.isArray(json)));
+        return typeof content === "string" && content.isJSON((json) => json && (typeof json === "object" || Array.isArray(json)));
     }
 
     _tryEnableCustomRequestContentView()