From 65e185f9a57c700c0498c6ad518847e9849d9333 Mon Sep 17 00:00:00 2001 From: Thays Grazia Date: Thu, 1 Feb 2024 19:46:15 -0300 Subject: [PATCH] Fixes exception while debugging on Chrome as IDE --- src/mono/wasm/debugger/BrowserDebugProxy/MonoProxy.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/mono/wasm/debugger/BrowserDebugProxy/MonoProxy.cs b/src/mono/wasm/debugger/BrowserDebugProxy/MonoProxy.cs index bbf199f0e79b63..d072301f84259c 100644 --- a/src/mono/wasm/debugger/BrowserDebugProxy/MonoProxy.cs +++ b/src/mono/wasm/debugger/BrowserDebugProxy/MonoProxy.cs @@ -1591,7 +1591,8 @@ internal virtual async Task OnSourceFileAdded(SessionId sessionId, SourceFile so await SendEvent(sessionId, "Debugger.scriptParsed", scriptSource, token); if (!resolveBreakpoints) return; - foreach (var req in context.BreakpointRequests.Values) + var breakpointRequests = context.BreakpointRequests.Values.ToList(); //this can be changed while we are looping it and cause an exception + foreach (var req in breakpointRequests) { if (req.TryResolve(source)) {