From 9f5beb99b5f89bec5c40e9f9660737a8a9a6041b Mon Sep 17 00:00:00 2001 From: James Yeung Date: Thu, 27 Jul 2023 22:40:47 +0800 Subject: [PATCH] fix(module: core): check ContainsKey for shared event subscriptions store of DomEventListener (#3364) --- components/core/JsInterop/DomEventListener.cs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/components/core/JsInterop/DomEventListener.cs b/components/core/JsInterop/DomEventListener.cs index c7bb2398..368029ec 100644 --- a/components/core/JsInterop/DomEventListener.cs +++ b/components/core/JsInterop/DomEventListener.cs @@ -82,6 +82,9 @@ namespace AntDesign.JsInterop var dotNetObject = DotNetObjectReference.Create(new Invoker((p) => { + if (!_domEventSubscriptionsStore.ContainsKey(key)) + return; + for (var i = 0; i < _domEventSubscriptionsStore[key].Count; i++) { var subscription = _domEventSubscriptionsStore[key][i];