Commit c204b2d2 authored by Sigurd Schneider's avatar Sigurd Schneider Committed by Commit Bot

[devtools] Defend against source locations without associated script

Apparently, we can get raw locations with a `null` content provider.
This CL filters them until we can prevent their generation altogether.

Bug: chromium:1005789
Change-Id: I02ababe8c3f3e355e9bc48622f15aa7c0d5f18b7
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1819300Reviewed-by: default avatarYang Guo <yangguo@chromium.org>
Commit-Queue: Sigurd Schneider <sigurds@chromium.org>
Cr-Commit-Position: refs/heads/master@{#698889}
parent eadbaf20
...@@ -223,7 +223,7 @@ Sources.SourceFormatter.ScriptMapping = class { ...@@ -223,7 +223,7 @@ Sources.SourceFormatter.ScriptMapping = class {
} }
if (uiSourceCode.contentType().isScript()) { if (uiSourceCode.contentType().isScript()) {
const rawLocations = Bindings.debuggerWorkspaceBinding.uiLocationToRawLocations(uiSourceCode, 0, 0); const rawLocations = Bindings.debuggerWorkspaceBinding.uiLocationToRawLocations(uiSourceCode, 0, 0);
return rawLocations.map(location => location.script()); return rawLocations.map(location => location.script()).filter(script => !!script);
} }
return []; return [];
} }
......
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