Skip to content

Commit c554846

Browse files
committed
Fix Sonar Issue
1 parent baea122 commit c554846

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

spring-rabbit/src/main/java/org/springframework/amqp/rabbit/core/RabbitTemplate.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1944,6 +1944,7 @@ protected Message doSendAndReceiveWithFixed(final String exchange, final String
19441944
@Nullable
19451945
private Message doSendAndReceiveWithDirect(String exchange, String routingKey, Message message,
19461946
@Nullable CorrelationData correlationData) {
1947+
19471948
ConnectionFactory connectionFactory = obtainTargetConnectionFactory(
19481949
this.sendConnectionFactorySelectorExpression, message);
19491950
if (this.usePublisherConnection && connectionFactory.getPublisherConnectionFactory() != null) {
@@ -1957,7 +1958,7 @@ private Message doSendAndReceiveWithDirect(String exchange, String routingKey, M
19571958
boolean cancelConsumer = false;
19581959
try {
19591960
Channel channel = channelHolder.getChannel();
1960-
if (isPublisherConfirmsOrReturns(connectionFactory)) {
1961+
if (isPublisherConfirmsOrReturns(connectionFactory)) { // NOSONAR false positive NP dereference
19611962
addListener(channel);
19621963
}
19631964
Message reply = doSendAndReceiveAsListener(exchange, routingKey, message, correlationData, channel,

0 commit comments

Comments
 (0)