From caf16bc03de557c096ffb07cd1b7e2eae92bd1ff Mon Sep 17 00:00:00 2001 From: Stepan Date: Fri, 9 Mar 2018 19:00:33 +0300 Subject: [PATCH] Concurrency fix for EventBus Prevent a possible race condition in InMemoryEventBusSubscriptionsManager --- .../EventBus/InMemoryEventBusSubscriptionsManager.cs | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/BuildingBlocks/EventBus/EventBus/InMemoryEventBusSubscriptionsManager.cs b/src/BuildingBlocks/EventBus/EventBus/InMemoryEventBusSubscriptionsManager.cs index 88be8cf96..305f9ff8a 100644 --- a/src/BuildingBlocks/EventBus/EventBus/InMemoryEventBusSubscriptionsManager.cs +++ b/src/BuildingBlocks/EventBus/EventBus/InMemoryEventBusSubscriptionsManager.cs @@ -112,10 +112,7 @@ namespace Microsoft.eShopOnContainers.BuildingBlocks.EventBus private void RaiseOnEventRemoved(string eventName) { var handler = OnEventRemoved; - if (handler != null) - { - OnEventRemoved(this, eventName); - } + handler?.Invoke(this, eventName); }