ARTEMIS-4962 mitigate NPE in FilterImpl
This commit is contained in:
parent
57adcd3286
commit
d929c5dd66
|
@ -163,14 +163,17 @@ public class FilterImpl implements Filter {
|
||||||
String amqpNativeID = msg.getStringProperty(NATIVE_MESSAGE_ID);
|
String amqpNativeID = msg.getStringProperty(NATIVE_MESSAGE_ID);
|
||||||
if (amqpNativeID != null) {
|
if (amqpNativeID != null) {
|
||||||
return SimpleString.of(amqpNativeID);
|
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 {
|
} 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)) {
|
} else if (FilterConstants.ACTIVEMQ_PRIORITY.equals(fieldName)) {
|
||||||
return (int) msg.getPriority();
|
return (int) msg.getPriority();
|
||||||
|
|
Loading…
Reference in New Issue