Avoid NullPointerException when jms destination is not available (#11570)
This commit is contained in:
parent
f533bf31f5
commit
55e723e810
|
@ -31,11 +31,13 @@ public abstract class MessageWithDestination {
|
|||
jmsDestination = fallbackDestination;
|
||||
}
|
||||
|
||||
if (jmsDestination.isQueue()) {
|
||||
return createMessageWithQueue(message, jmsDestination);
|
||||
}
|
||||
if (jmsDestination.isTopic()) {
|
||||
return createMessageWithTopic(message, jmsDestination);
|
||||
if (jmsDestination != null) {
|
||||
if (jmsDestination.isQueue()) {
|
||||
return createMessageWithQueue(message, jmsDestination);
|
||||
}
|
||||
if (jmsDestination.isTopic()) {
|
||||
return createMessageWithTopic(message, jmsDestination);
|
||||
}
|
||||
}
|
||||
return new AutoValue_MessageWithDestination(
|
||||
message, "unknown", /* isTemporaryDestination= */ false);
|
||||
|
|
Loading…
Reference in New Issue