Skip to content

Commit 81bba75

Browse files
committed
Null-proof reply post processor in request/response classes
1 parent 00d87ee commit 81bba75

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/main/java/com/rabbitmq/client/amqp/impl/AmqpRpcServer.java

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,13 @@ public Message message(byte[] body) {
8585
this.correlationIdExtractor = builder.correlationIdExtractor();
8686
}
8787
if (builder.replyPostProcessor() == null) {
88-
this.replyPostProcessor = Message::correlationId;
88+
this.replyPostProcessor =
89+
(msg, corrId) -> {
90+
if (msg != null) {
91+
msg.correlationId(corrId);
92+
}
93+
return msg;
94+
};
8995
} else {
9096
this.replyPostProcessor = builder.replyPostProcessor();
9197
}

0 commit comments

Comments
 (0)