Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/dotnet/runtime.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThays Grazia <thaystg@gmail.com>2022-10-05 23:16:54 +0300
committerGitHub <noreply@github.com>2022-10-05 23:16:54 +0300
commit754d1c241ef4a45e6a7b4adabf346ec3e1eff206 (patch)
tree687020ef76deb3558da0a26e4bcbc3cc0e4851db
parentb8accad28b101a98a47169d5bcd54bb5c784aa1e (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.cs4
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[]>();