Skip to content

Commit 631a183

Browse files
committed
Fixed issue where UEA would throw an exception if nothing is listening for message.
1 parent 289bf80 commit 631a183

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

src/UnityEventAggregator/EventAggregator.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@ public static void UnRegister(object obj, Type listener)
6565
/// <param name="message"></param>
6666
public static void SendMessage<T>(T message)
6767
{
68+
if (!_cache.ContainsKey(message.GetType())) return;
6869
_cache[message.GetType()].Each(x => ((IListener<T>)x).Handle(message));
6970
}
7071

0 commit comments

Comments
 (0)