Skip to content

Commit

Permalink
Avoid NullPointerException when jms destination is not available (#11570
Browse files Browse the repository at this point in the history
)
  • Loading branch information
laurit authored Jun 13, 2024
1 parent f533bf3 commit 55e723e
Showing 1 changed file with 7 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,13 @@ public static MessageWithDestination create(
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);
Expand Down

0 comments on commit 55e723e

Please sign in to comment.