Skip to content

Commit

Permalink
[release/v1.33.x] Avoid NullPointerException when jms destination is …
Browse files Browse the repository at this point in the history
…not available (#11577)

Co-authored-by: Lauri Tulmin <ltulmin@splunk.com>
  • Loading branch information
opentelemetrybot and laurit committed Jun 13, 2024
1 parent b6c5376 commit 23883df
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 23883df

Please sign in to comment.