Skip to content

Commit 754d1c2

Browse files
authored
[release/6.0] [wasm][debugger] Fix debugging an app that has another .NET Wasm instance in a service worker (#76075)
* backport 76072 * Update MonoProxy.cs
1 parent b8accad commit 754d1c2

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/mono/wasm/debugger/BrowserDebugProxy/MonoProxy.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,9 @@ protected override async Task<bool> AcceptEvent(SessionId sessionId, string meth
5555
{
5656
case "Runtime.consoleAPICalled":
5757
{
58+
// Don't process events from sessions we aren't tracking
59+
if (!contexts.TryGetValue(sessionId, out ExecutionContext context))
60+
return false;
5861
string type = args["type"]?.ToString();
5962
if (type == "debug")
6063
{
@@ -68,7 +71,6 @@ protected override async Task<bool> AcceptEvent(SessionId sessionId, string meth
6871
{
6972
// The optional 3rd argument is the stringified assembly
7073
// list so that we don't have to make more round trips
71-
ExecutionContext context = GetContext(sessionId);
7274
string loaded = a?[2]?["value"]?.ToString();
7375
if (loaded != null)
7476
context.LoadedFiles = JToken.Parse(loaded).ToObject<string[]>();

0 commit comments

Comments
 (0)