ARTEMIS-2802: Add a null check when checking matching metaData inside

Federated Queue

Other protocols besides CORE may not have a metadata map so we need to
check for null before passing to the filter matcher
This commit is contained in:
Christopher L. Shannon (cshannon) 2021-02-23 10:24:13 -05:00 committed by Justin Bertram
parent 9d4f88c1e5
commit 4c4d7a71cb
1 changed files with 2 additions and 1 deletions

View File

@ -143,7 +143,8 @@ public class FederatedQueue extends FederatedAbstract implements ActiveMQServerC
//We check the session meta data to see if its a federation session, if so by default we ignore these. //We check the session meta data to see if its a federation session, if so by default we ignore these.
//To not ignore these, set include-federated to true, which will mean no meta data filter. //To not ignore these, set include-federated to true, which will mean no meta data filter.
ServerSession serverSession = server.getSessionByID(consumer.getSessionID()); ServerSession serverSession = server.getSessionByID(consumer.getSessionID());
if (metaDataFilter != null && serverSession != null && metaDataFilter.match(serverSession.getMetaData())) { if (metaDataFilter != null && serverSession != null && serverSession.getMetaData() != null &&
metaDataFilter.match(serverSession.getMetaData())) {
return; return;
} }
if (match(consumer)) { if (match(consumer)) {