Skip to content

Commit

Permalink
Skip handlers that are 'null'
Browse files Browse the repository at this point in the history
  • Loading branch information
x789 committed Oct 3, 2021
1 parent aaffd19 commit 4e6be02
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/NSubstitute/Routing/Handlers/RaiseEventHandler.cs
Expand Up @@ -30,6 +30,11 @@ public RouteAction Handle(ICall call)
var handlers = _eventHandlerRegistry.GetHandlers(eventInfo.Name);
foreach (Delegate handler in handlers)
{
if (handler == null)
{
continue;
}

try
{
handler.DynamicInvoke(eventArguments);
Expand Down

0 comments on commit 4e6be02

Please sign in to comment.