Browse Source

Protect against NPE in DefaultSubscriptionRegistry

Follow-up fix on the recent commit:
https://github.com/spring-projects/spring-framework/commit/4fc41e

Issue: SPR-15543
pull/1420/merge
Rossen Stoyanchev 9 years ago
parent
commit
8deec9569c
  1. 3
      spring-messaging/src/main/java/org/springframework/messaging/simp/broker/DefaultSubscriptionRegistry.java

3
spring-messaging/src/main/java/org/springframework/messaging/simp/broker/DefaultSubscriptionRegistry.java

@ -293,7 +293,8 @@ public class DefaultSubscriptionRegistry extends AbstractSubscriptionRegistry { @@ -293,7 +293,8 @@ public class DefaultSubscriptionRegistry extends AbstractSubscriptionRegistry {
if (getPathMatcher().match(destination, cachedDestination)) {
LinkedMultiValueMap<String, String> subs = entry.getValue();
// Subscription id's may also be populated via getSubscriptions()
if (!subs.containsKey(sessionId) || !subs.get(sessionId).contains(subsId)) {
List<String> subsForSession = subs.get(sessionId);
if (subsForSession == null || !subsForSession.contains(subsId)) {
subs.add(sessionId, subsId);
this.accessCache.put(cachedDestination, subs.deepCopy());
}

Loading…
Cancel
Save