Skip to content

Commit 439d368

Browse files
[~] Fix named unsubscribe CactuseSecurity#3145
1 parent 489bd2d commit 439d368

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

roles/lib/files/FWO.Services/EventMediator/EventMediator.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,9 +54,9 @@ public void Publish<TEvent>(string name, TEvent @event) where TEvent : class, IE
5454
/// <returns>True/False if remove was successfull</returns>
5555
public bool Unsubscribe<TEvent>(string name) where TEvent : class, IEvent
5656
{
57-
if(_handlers.ContainsKey(typeof(TEvent)))
57+
if(_handlers.ContainsKey(typeof(TEvent)) && _handlers[typeof(TEvent)].ContainsKey(name))
5858
{
59-
return _handlers.Remove(typeof(TEvent));
59+
return _handlers[typeof(TEvent)].Remove(name);
6060
}
6161

6262
return false;

0 commit comments

Comments
 (0)