From 95e3c2a1aa0d4962ad6a22a4422a9314875f824b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jean-Baptiste=20Onofr=C3=A9?= Date: Wed, 21 Jun 2023 07:38:36 +0200 Subject: [PATCH] [AMQ-9233] Prevent NPE in SubQueueSelectorCacheBroker --- .../org/apache/activemq/plugin/SubQueueSelectorCacheBroker.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/activemq-broker/src/main/java/org/apache/activemq/plugin/SubQueueSelectorCacheBroker.java b/activemq-broker/src/main/java/org/apache/activemq/plugin/SubQueueSelectorCacheBroker.java index 322e1e7126..50cdaf3550 100644 --- a/activemq-broker/src/main/java/org/apache/activemq/plugin/SubQueueSelectorCacheBroker.java +++ b/activemq-broker/src/main/java/org/apache/activemq/plugin/SubQueueSelectorCacheBroker.java @@ -180,7 +180,7 @@ public class SubQueueSelectorCacheBroker extends BrokerFilter implements Runnabl if (singleSelectorPerDestination) { String destinationName = info.getDestination().getQualifiedName(); Set selectors = subSelectorCache.get(destinationName); - if (info.getSelector() == null && selectors.size() > 1) { + if (info.getSelector() == null && (selectors != null && selectors.size() > 1)) { boolean removed = selectors.remove(MATCH_EVERYTHING); LOG.debug("A non-selector consumer has dropped. Removing the catchall matching pattern 'TRUE'. Successful? " + removed); }