Skip to content

Commit 28a7490

Browse files
committed
Check outstanding RPC is not null
Before it receives the handling of the command. The outstanding RPC can be null in case of async call.
1 parent 9e4a121 commit 28a7490

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,7 @@
196196
197197
Currently, those test brokers will listen to the default
198198
TCP ports of 5672 and 5673 for AMQP and 5671 and 5670
199-
for AMQP+TLS. Unforunately, this means no other standard
199+
for AMQP+TLS. Unfortunately, this means no other standard
200200
RabbitMQ can run on the same host at the same time.
201201
-->
202202
<execution>

src/main/java/com/rabbitmq/client/impl/AMQChannel.java

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -143,8 +143,12 @@ public void handleCompleteInboundCommand(AMQCommand command) throws IOException
143143
if (!processAsync(command)) {
144144
// The filter decided not to handle/consume the command,
145145
// so it must be some reply to an earlier RPC.
146-
nextOutstandingRpc().handleCommand(command);
147-
markRpcFinished();
146+
RpcContinuation nextOutstandingRpc = nextOutstandingRpc();
147+
// the outstanding RPC can be null when calling Channel#asyncRpc
148+
if(nextOutstandingRpc != null) {
149+
nextOutstandingRpc.handleCommand(command);
150+
markRpcFinished();
151+
}
148152
}
149153
}
150154

0 commit comments

Comments
 (0)