Skip to content

Commit ff8ef23

Browse files
committed
Check for null blocker in RpcClient
Fixes #306
1 parent afef845 commit ff8ef23

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/main/java/com/rabbitmq/client/RpcClient.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -190,8 +190,10 @@ public void handleDelivery(String consumerTag,
190190
throws IOException {
191191
synchronized (_continuationMap) {
192192
String replyId = properties.getCorrelationId();
193-
BlockingCell<Object> blocker = _continuationMap.get(replyId);
194-
_continuationMap.remove(replyId);
193+
BlockingCell<Object> blocker =_continuationMap.remove(replyId);
194+
if (blocker == null) {
195+
throw new IllegalStateException("No outstanding request for correlation ID " + replyId);
196+
}
195197
blocker.set(new Response(consumerTag, envelope, properties, body));
196198
}
197199
}

0 commit comments

Comments
 (0)