Skip to content

Commit 88c45cc

Browse files
ivamlysobychacko
authored andcommitted
GH-3697: DelegatingInvocableHandler.invoke() returning null
Fixes: #3697 Issue: #3697 Signed-off-by: ivamly <[email protected]>
1 parent 272c4b0 commit 88c45cc

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

spring-kafka/src/main/java/org/springframework/kafka/listener/adapter/DelegatingInvocableHandler.java

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@
5656
*
5757
* @author Gary Russell
5858
* @author Wang Zhiyang
59+
* @author Ivan Malutin
5960
*
6061
*/
6162
public class DelegatingInvocableHandler {
@@ -188,8 +189,13 @@ public Object invoke(Message<?> message, @Nullable Object... providedArgs) throw
188189
else {
189190
result = handler.invoke(message, providedArgs);
190191
}
191-
Expression replyTo = this.handlerSendTo.get(handler);
192-
return new InvocationResult(result, replyTo, this.handlerReturnsMessage.get(handler));
192+
if (result != null) {
193+
Expression replyTo = this.handlerSendTo.get(handler);
194+
return new InvocationResult(result, replyTo, this.handlerReturnsMessage.get(handler));
195+
}
196+
else {
197+
return null;
198+
}
193199
}
194200

195201
/**

0 commit comments

Comments
 (0)