ARTEMIS-4962 mitigate NPE in FilterImpl

This commit is contained in:
Justin Bertram 2024-08-30 11:03:08 -05:00
parent 57adcd3286
commit d929c5dd66
1 changed files with 9 additions and 6 deletions

View File

@ -163,14 +163,17 @@ public class FilterImpl implements Filter {
String amqpNativeID = msg.getStringProperty(NATIVE_MESSAGE_ID);
if (amqpNativeID != null) {
return SimpleString.of(amqpNativeID);
} else {
return null;
}
}
// It's the stringified (hex) representation of a user id that can be used in a selector expression
String userID = msg.getUserID().toString();
if (userID.startsWith("ID:")) {
return SimpleString.of(userID);
} else {
return SimpleString.of("ID:" + msg.getUserID());
// It's the stringified (hex) representation of a user id that can be used in a selector expression
String userID = msg.getUserID().toString();
if (userID.startsWith("ID:")) {
return SimpleString.of(userID);
} else {
return SimpleString.of("ID:" + msg.getUserID());
}
}
} else if (FilterConstants.ACTIVEMQ_PRIORITY.equals(fieldName)) {
return (int) msg.getPriority();