diff options
author | Thays Grazia <thaystg@gmail.com> | 2022-10-05 23:16:54 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-10-05 23:16:54 +0300 |
commit | 754d1c241ef4a45e6a7b4adabf346ec3e1eff206 (patch) | |
tree | 687020ef76deb3558da0a26e4bcbc3cc0e4851db | |
parent | b8accad28b101a98a47169d5bcd54bb5c784aa1e (diff) |
[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
-rw-r--r-- | src/mono/wasm/debugger/BrowserDebugProxy/MonoProxy.cs | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/mono/wasm/debugger/BrowserDebugProxy/MonoProxy.cs b/src/mono/wasm/debugger/BrowserDebugProxy/MonoProxy.cs index e49424a3fae..e4940edb7b2 100644 --- a/src/mono/wasm/debugger/BrowserDebugProxy/MonoProxy.cs +++ b/src/mono/wasm/debugger/BrowserDebugProxy/MonoProxy.cs @@ -55,6 +55,9 @@ namespace Microsoft.WebAssembly.Diagnostics { case "Runtime.consoleAPICalled": { + // Don't process events from sessions we aren't tracking + if (!contexts.TryGetValue(sessionId, out ExecutionContext context)) + return false; string type = args["type"]?.ToString(); if (type == "debug") { @@ -68,7 +71,6 @@ namespace Microsoft.WebAssembly.Diagnostics { // The optional 3rd argument is the stringified assembly // list so that we don't have to make more round trips - ExecutionContext context = GetContext(sessionId); string loaded = a?[2]?["value"]?.ToString(); if (loaded != null) context.LoadedFiles = JToken.Parse(loaded).ToObject<string[]>(); |