Repository: activemq
Updated Branches:
  refs/heads/activemq-5.11.x 73a0caf75 -> 7706b5aa6


AMQ-5933 - add test and fix

(cherry picked from commit 3c2ed9352b38f39ba57b322b9006ab82d7a4470f)


Project: http://git-wip-us.apache.org/repos/asf/activemq/repo
Commit: http://git-wip-us.apache.org/repos/asf/activemq/commit/cdf13b20
Tree: http://git-wip-us.apache.org/repos/asf/activemq/tree/cdf13b20
Diff: http://git-wip-us.apache.org/repos/asf/activemq/diff/cdf13b20

Branch: refs/heads/activemq-5.11.x
Commit: cdf13b20d86d3da4ad77d77306f51bf5128e25cc
Parents: 73a0caf
Author: gtully <[email protected]>
Authored: Wed Aug 19 15:02:09 2015 +0100
Committer: Daniel Kulp <[email protected]>
Committed: Wed Oct 28 09:51:09 2015 -0400

----------------------------------------------------------------------
 .../SelectorAwareVirtualTopicInterceptor.java     | 18 ++++++++++--------
 1 file changed, 10 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/activemq/blob/cdf13b20/activemq-broker/src/main/java/org/apache/activemq/broker/region/virtual/SelectorAwareVirtualTopicInterceptor.java
----------------------------------------------------------------------
diff --git 
a/activemq-broker/src/main/java/org/apache/activemq/broker/region/virtual/SelectorAwareVirtualTopicInterceptor.java
 
b/activemq-broker/src/main/java/org/apache/activemq/broker/region/virtual/SelectorAwareVirtualTopicInterceptor.java
index 0c19565..7061f90 100644
--- 
a/activemq-broker/src/main/java/org/apache/activemq/broker/region/virtual/SelectorAwareVirtualTopicInterceptor.java
+++ 
b/activemq-broker/src/main/java/org/apache/activemq/broker/region/virtual/SelectorAwareVirtualTopicInterceptor.java
@@ -87,15 +87,17 @@ public class SelectorAwareVirtualTopicInterceptor extends 
VirtualTopicIntercepto
 
         if (cache != null) {
             final Set<String> selectors = 
cache.getSelector(dest.getActiveMQDestination().getQualifiedName());
-            for (String selector : selectors) {
-                try {
-                    final BooleanExpression expression = 
getExpression(selector);
-                    matches = expression.matches(msgContext);
-                    if (matches) {
-                        return true;
+            if (selectors != null) {
+                for (String selector : selectors) {
+                    try {
+                        final BooleanExpression expression = 
getExpression(selector);
+                        matches = expression.matches(msgContext);
+                        if (matches) {
+                            return true;
+                        }
+                    } catch (Exception e) {
+                        LOG.error(e.getMessage(), e);
                     }
-                } catch (Exception e) {
-                    LOG.error(e.getMessage(), e);
                 }
             }
         }

Reply via email to