[DevTools] removeFrameAttribution should be safer

uiSourceCode may have no attribution, e.g. in case when there is no
frames in Node.js environment.
addFrameAttribution and cloneInitialFrameAttribution check frame or
attribution for existing, let's do the same in removeFrameAttribution.

[email protected]
[email protected]

Bug: none
Change-Id: I373d4faaa40210a9445a1f3cc4ea1abb72ec72db
Reviewed-on: https://chromium-review.googlesource.com/1123708
Commit-Queue: Aleksey Kozyatinskiy <[email protected]>
Reviewed-by: Joel Einbinder <[email protected]>
Cr-Original-Commit-Position: refs/heads/master@{#572357}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: 836a168b0e04136d050b85fda8da940f3760f188
diff --git a/front_end/bindings/NetworkProject.js b/front_end/bindings/NetworkProject.js
index 50c7d67..cddee9d 100644
--- a/front_end/bindings/NetworkProject.js
+++ b/front_end/bindings/NetworkProject.js
@@ -106,6 +106,8 @@
    */
   static removeFrameAttribution(uiSourceCode, frameId) {
     const frameAttribution = uiSourceCode[Bindings.NetworkProject._frameAttributionSymbol];
+    if (!frameAttribution)
+      return;
     const attributionInfo = frameAttribution.get(frameId);
     console.assert(attributionInfo, 'Failed to remove frame attribution for url: ' + uiSourceCode.url());
     attributionInfo.count -= 1;