From 89bf58445fb1dcc0275c605c0e83abf82a9b9492 Mon Sep 17 00:00:00 2001 From: Ryan Nowak Date: Sat, 10 Aug 2019 18:13:16 -0700 Subject: [PATCH] Use a ConcurrentDictionary This is used from a bunch of static methods. Dictionary isn't thread safe. Encountered this while debugging some other things. --- .../BasicTestApp/InteropTest/JavaScriptInterop.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Components/test/testassets/BasicTestApp/InteropTest/JavaScriptInterop.cs b/src/Components/test/testassets/BasicTestApp/InteropTest/JavaScriptInterop.cs index a0f35c8040..f8b8c154e7 100644 --- a/src/Components/test/testassets/BasicTestApp/InteropTest/JavaScriptInterop.cs +++ b/src/Components/test/testassets/BasicTestApp/InteropTest/JavaScriptInterop.cs @@ -1,17 +1,17 @@ // Copyright (c) .NET Foundation. All rights reserved. // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. -using Microsoft.JSInterop; using System; +using System.Collections.Concurrent; using System.Collections.Generic; -using System.Text.Json; using System.Threading.Tasks; +using Microsoft.JSInterop; namespace BasicTestApp.InteropTest { public class JavaScriptInterop { - public static IDictionary Invocations = new Dictionary(); + public static ConcurrentDictionary Invocations = new ConcurrentDictionary(); [JSInvokable] public static void ThrowException() => throw new InvalidOperationException("Threw an exception!");