Skip to content

Commit afd0d33

Browse files
committed
resolved #171
1 parent c3ddede commit afd0d33

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/CatLib.Core/CatLib/Events/DispatcherExtend.cs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,10 @@ public static IEvent On(this IDispatcher dispatcher, string eventName, object ta
5757
Guard.Requires<ArgumentNullException>(target != null);
5858
}
5959

60-
return dispatcher.On(eventName, (_, userParams) => App.Call(target, methodInfo, userParams), group);
60+
return dispatcher.On(eventName,
61+
(_, userParams) => App.HasHandler
62+
? App.Call(target, methodInfo, userParams)
63+
: methodInfo.Invoke(target, userParams), group);
6164
}
6265

6366
/// <summary>

0 commit comments

Comments
 (0)