You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@eventmesh.apache.org by jo...@apache.org on 2023/02/19 02:40:27 UTC
[incubator-eventmesh] branch master updated: [ISSUE #3170] function parameter NPE check fix (#3189)
This is an automated email from the ASF dual-hosted git repository.
jonyang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-eventmesh.git
The following commit(s) were added to refs/heads/master by this push:
new 8c1cb3d69 [ISSUE #3170] function parameter NPE check fix (#3189)
8c1cb3d69 is described below
commit 8c1cb3d69f3dfbbf581c78cbaf81cdb240c0acf7
Author: Dimuthu Weerathunga <67...@users.noreply.github.com>
AuthorDate: Sun Feb 19 08:10:23 2023 +0530
[ISSUE #3170] function parameter NPE check fix (#3189)
---
.../org/apache/eventmesh/connector/kafka/producer/ProducerImpl.java | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/eventmesh-connector-plugin/eventmesh-connector-kafka/src/main/java/org/apache/eventmesh/connector/kafka/producer/ProducerImpl.java b/eventmesh-connector-plugin/eventmesh-connector-kafka/src/main/java/org/apache/eventmesh/connector/kafka/producer/ProducerImpl.java
index e7613fef0..670aa46dd 100644
--- a/eventmesh-connector-plugin/eventmesh-connector-kafka/src/main/java/org/apache/eventmesh/connector/kafka/producer/ProducerImpl.java
+++ b/eventmesh-connector-plugin/eventmesh-connector-kafka/src/main/java/org/apache/eventmesh/connector/kafka/producer/ProducerImpl.java
@@ -29,6 +29,7 @@ import org.apache.kafka.clients.producer.ProducerConfig;
import org.apache.kafka.clients.producer.ProducerRecord;
import org.apache.kafka.common.serialization.StringSerializer;
+import java.util.Objects;
import java.util.Properties;
import java.util.Set;
import java.util.concurrent.ExecutionException;
@@ -80,7 +81,7 @@ public class ProducerImpl {
public void send(CloudEvent cloudEvent) {
try {
- this.producer.send(new ProducerRecord<>(cloudEvent.getSubject(), cloudEvent));
+ this.producer.send(new ProducerRecord<>(Objects.requireNonNull(cloudEvent.getSubject()), cloudEvent));
} catch (Exception e) {
log.error(String.format("Send message oneway Exception, %s", cloudEvent), e);
}
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@eventmesh.apache.org
For additional commands, e-mail: commits-help@eventmesh.apache.org