From e52bc821e10d219f94a5defa27ddce02cb584278 Mon Sep 17 00:00:00 2001 From: maliming Date: Thu, 2 Jan 2025 12:08:51 +0800 Subject: [PATCH] Avoid `HandlerFactories` being changed during iteration. Resolve #20625 --- .../src/Volo.Abp.EventBus/Volo/Abp/EventBus/EventBusBase.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/framework/src/Volo.Abp.EventBus/Volo/Abp/EventBus/EventBusBase.cs b/framework/src/Volo.Abp.EventBus/Volo/Abp/EventBus/EventBusBase.cs index ef5c5cdabc..7c60d69063 100644 --- a/framework/src/Volo.Abp.EventBus/Volo/Abp/EventBus/EventBusBase.cs +++ b/framework/src/Volo.Abp.EventBus/Volo/Abp/EventBus/EventBusBase.cs @@ -135,7 +135,7 @@ public abstract class EventBusBase : IEventBus { await new SynchronizationContextRemover(); - foreach (var handlerFactories in GetHandlerFactories(eventType)) + foreach (var handlerFactories in GetHandlerFactories(eventType).ToList()) { foreach (var handlerFactory in handlerFactories.EventHandlerFactories) {