You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by or...@apache.org on 2022/10/24 13:57:40 UTC

[camel] 01/05: CAMEL-18148: fixed NPE while sending records

This is an automated email from the ASF dual-hosted git repository.

orpiske pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/camel.git

commit 6a5499c14193fd06045bc6c093a746d20e21895d
Author: Otavio Rodolfo Piske <an...@gmail.com>
AuthorDate: Mon Oct 24 14:30:47 2022 +0200

    CAMEL-18148: fixed NPE while sending records
---
 .../camel/processor/resume/kafka/SingleNodeKafkaResumeStrategy.java   | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/components/camel-kafka/src/main/java/org/apache/camel/processor/resume/kafka/SingleNodeKafkaResumeStrategy.java b/components/camel-kafka/src/main/java/org/apache/camel/processor/resume/kafka/SingleNodeKafkaResumeStrategy.java
index fe7459f9d09..2e2bbaba3fe 100644
--- a/components/camel-kafka/src/main/java/org/apache/camel/processor/resume/kafka/SingleNodeKafkaResumeStrategy.java
+++ b/components/camel-kafka/src/main/java/org/apache/camel/processor/resume/kafka/SingleNodeKafkaResumeStrategy.java
@@ -105,7 +105,9 @@ public class SingleNodeKafkaResumeStrategy<T extends Resumable> implements Kafka
         ProducerRecord<byte[], byte[]> record = new ProducerRecord<>(resumeStrategyConfiguration.getTopic(), key, message);
 
         producer.send(record, (recordMetadata, e) -> {
-            LOG.error("Failed to send message {}", e.getMessage(), e);
+            if (e != null) {
+                LOG.error("Failed to send message {}", e.getMessage(), e);
+            }
 
             if (updateCallBack != null) {
                 updateCallBack.onUpdate(e);