Web Inspector: Uncaught exception: TypeError: this._initiatorSourceCodeLocation.sourc...
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 8 Jan 2016 20:14:20 +0000 (20:14 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 8 Jan 2016 20:14:20 +0000 (20:14 +0000)
https://bugs.webkit.org/show_bug.cgi?id=152905
<rdar://problem/24109809>

Patch by Joseph Pecoraro <pecoraro@apple.com> on 2016-01-08
Reviewed by Brian Burg.

* UserInterface/Models/Resource.js:
(WebInspector.Resource):
(WebInspector.Resource.prototype.addInitiatedResource):
Only Resource has addInitiatedResource, so only call it if the
SourceCode in the SourceCodeLocation is a Resource.

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

Source/WebInspectorUI/ChangeLog
Source/WebInspectorUI/UserInterface/Models/Resource.js

index ddd1aac..3012523 100644 (file)
@@ -1,3 +1,17 @@
+2016-01-08  Joseph Pecoraro  <pecoraro@apple.com>
+
+        Web Inspector: Uncaught exception: TypeError: this._initiatorSourceCodeLocation.sourceCode.addInitiatedResource is not a function
+        https://bugs.webkit.org/show_bug.cgi?id=152905
+        <rdar://problem/24109809>
+
+        Reviewed by Brian Burg.
+
+        * UserInterface/Models/Resource.js:
+        (WebInspector.Resource):
+        (WebInspector.Resource.prototype.addInitiatedResource):
+        Only Resource has addInitiatedResource, so only call it if the
+        SourceCode in the SourceCodeLocation is a Resource.
+
 2016-01-07  Devin Rousso  <dcrousso+webkit@gmail.com>
 
         Web Inspector: Add warnings to section that require specific values of other properties
index 2c70b3e..c2457e8 100644 (file)
@@ -59,7 +59,7 @@ WebInspector.Resource = class Resource extends WebInspector.SourceCode
         this._transferSize = NaN;
         this._cached = false;
 
-        if (this._initiatorSourceCodeLocation)
+        if (this._initiatorSourceCodeLocation && this._initiatorSourceCodeLocation.sourceCode instanceof WebInspector.Resource)
             this._initiatorSourceCodeLocation.sourceCode.addInitiatedResource(this);
     }
 
@@ -224,7 +224,8 @@ WebInspector.Resource = class Resource extends WebInspector.SourceCode
         return this._parentFrame ? this._parentFrame.mainResource === this : false;
     }
 
-    addInitiatedResource(resource) {
+    addInitiatedResource(resource)
+    {
         if (!(resource instanceof WebInspector.Resource))
             return;