commit | 4c2bb7b30ddbdb6927137c64a67f8e45feba3a60 | [log] [tgz] |
---|---|---|
author | Alexey Kozyatinskiy <[email protected]> | Tue Jul 03 21:22:58 2018 |
committer | Commit Bot <[email protected]> | Tue Jul 03 21:22:58 2018 |
tree | 1529b226ec8911459aed2c8f575eb8db2375bcae | |
parent | 214ada92c8dcb0877d37969ff6191195da5daf1a [diff] [blame] |
[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;