Skip to content

Commit

Permalink
Fix Sonar Issue
Browse files Browse the repository at this point in the history
  • Loading branch information
garyrussell committed Apr 20, 2022
1 parent 3b4a7e4 commit 59197ca
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -1944,6 +1944,7 @@ protected Message doSendAndReceiveWithFixed(final String exchange, final String
@Nullable
private Message doSendAndReceiveWithDirect(String exchange, String routingKey, Message message,
@Nullable CorrelationData correlationData) {

ConnectionFactory connectionFactory = obtainTargetConnectionFactory(
this.sendConnectionFactorySelectorExpression, message);
if (this.usePublisherConnection && connectionFactory.getPublisherConnectionFactory() != null) {
Expand All @@ -1957,7 +1958,7 @@ private Message doSendAndReceiveWithDirect(String exchange, String routingKey, M
boolean cancelConsumer = false;
try {
Channel channel = channelHolder.getChannel();
if (isPublisherConfirmsOrReturns(connectionFactory)) {
if (isPublisherConfirmsOrReturns(connectionFactory)) { // NOSONAR false positive NP dereference
addListener(channel);
}
Message reply = doSendAndReceiveAsListener(exchange, routingKey, message, correlationData, channel,
Expand Down

0 comments on commit 59197ca

Please sign in to comment.