This is an automated email from the ASF dual-hosted git repository.
jbonofre pushed a commit to branch activemq-5.18.x
in repository https://gitbox.apache.org/repos/asf/activemq.git
The following commit(s) were added to refs/heads/activemq-5.18.x by this push:
new 2383a06b20 [AMQ-9233] Prevent NPE in SubQueueSelectorCacheBroker
2383a06b20 is described below
commit 2383a06b20c4d32f2ac44271c91f7deb80bfc38c
Author: Jean-Baptiste Onofré <[email protected]>
AuthorDate: Wed Jun 21 07:38:36 2023 +0200
[AMQ-9233] Prevent NPE in SubQueueSelectorCacheBroker
(cherry picked from commit 95e3c2a1aa0d4962ad6a22a4422a9314875f824b)
---
.../java/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<String> 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);
}