Fix NullPointerException when no subscriber for slow event (#3835)

This commit is contained in:
杨翊 SionYang 2020-09-15 14:50:57 +08:00 committed by GitHub
parent 5e4429f0e4
commit 565557c5c5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 0 deletions

View File

@ -96,6 +96,10 @@ public class DefaultSharePublisher extends DefaultPublisher {
// 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) {

View File

@ -132,6 +132,7 @@ public class NotifyCenterTest {
return ExpireEvent.class;
}
@Override
public boolean ignoreExpireEvent() {
return true;
}