Skip to content

Commit

Permalink
Fix NullPointerException when no subscriber for slow event (#3835)
Browse files Browse the repository at this point in the history
  • Loading branch information
KomachiSion authored Sep 15, 2020
1 parent 5e4429f commit 565557c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,10 @@ public void receiveEvent(Event event) {

// Get for Map, the algorithm is O(1).
Set<Subscriber> subscribers = subMappings.get(slowEventType);
if (null == subscribers) {
LOGGER.debug("[NotifyCenter] No subscribers for slow event {}", slowEventType.getName());
return;
}

// Notification single event subscriber
for (Subscriber subscriber : subscribers) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,7 @@ public Class<? extends Event> subscribeType() {
return ExpireEvent.class;
}

@Override
public boolean ignoreExpireEvent() {
return true;
}
Expand Down

0 comments on commit 565557c

Please sign in to comment.