Commit 836a168b authored by Alexey Kozyatinskiy's avatar Alexey Kozyatinskiy Committed by Commit Bot

[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.

R=einbinder@chromium.org
TBR=pfeldman@chromium.org

Bug: none
Change-Id: I373d4faaa40210a9445a1f3cc4ea1abb72ec72db
Reviewed-on: https://chromium-review.googlesource.com/1123708
Commit-Queue: Aleksey Kozyatinskiy <kozyatinskiy@chromium.org>
Reviewed-by: default avatarJoel Einbinder <einbinder@chromium.org>
Cr-Commit-Position: refs/heads/master@{#572357}
parent fee4934f
...@@ -106,6 +106,8 @@ Bindings.NetworkProject = class { ...@@ -106,6 +106,8 @@ Bindings.NetworkProject = class {
*/ */
static removeFrameAttribution(uiSourceCode, frameId) { static removeFrameAttribution(uiSourceCode, frameId) {
const frameAttribution = uiSourceCode[Bindings.NetworkProject._frameAttributionSymbol]; const frameAttribution = uiSourceCode[Bindings.NetworkProject._frameAttributionSymbol];
if (!frameAttribution)
return;
const attributionInfo = frameAttribution.get(frameId); const attributionInfo = frameAttribution.get(frameId);
console.assert(attributionInfo, 'Failed to remove frame attribution for url: ' + uiSourceCode.url()); console.assert(attributionInfo, 'Failed to remove frame attribution for url: ' + uiSourceCode.url());
attributionInfo.count -= 1; attributionInfo.count -= 1;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment