You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@eventmesh.apache.org by mi...@apache.org on 2023/03/12 06:39:27 UTC

[incubator-eventmesh] branch master updated: require null check

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

mikexue 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 4c953be14 require null check
     new aad56e03e Merge pull request #3374 from Bhaskar1312/master
4c953be14 is described below

commit 4c953be14bd96a9c2c3275e96bd357153604e2ef
Author: Bhaskar Bantupalli <bh...@gmail.com>
AuthorDate: Thu Mar 9 00:09:56 2023 +0530

    require null check
---
 .../org/apache/eventmesh/client/http/producer/CloudEventProducer.java  | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/eventmesh-sdk-java/src/main/java/org/apache/eventmesh/client/http/producer/CloudEventProducer.java b/eventmesh-sdk-java/src/main/java/org/apache/eventmesh/client/http/producer/CloudEventProducer.java
index e06c6d4dd..63645f3e0 100644
--- a/eventmesh-sdk-java/src/main/java/org/apache/eventmesh/client/http/producer/CloudEventProducer.java
+++ b/eventmesh-sdk-java/src/main/java/org/apache/eventmesh/client/http/producer/CloudEventProducer.java
@@ -32,6 +32,7 @@ import org.apache.eventmesh.common.utils.JsonUtils;
 import org.apache.eventmesh.common.utils.RandomStringUtils;
 
 import java.nio.charset.StandardCharsets;
+import java.util.Objects;
 
 import io.cloudevents.CloudEvent;
 import io.cloudevents.core.builder.CloudEventBuilder;
@@ -75,7 +76,7 @@ class CloudEventProducer extends AbstractProducerHttpClient<CloudEvent> {
 
     private RequestParam buildCommonPostParam(final CloudEvent cloudEvent) {
         validateCloudEvent(cloudEvent);
-        final byte[] bodyByte = EventFormatProvider.getInstance().resolveFormat(cloudEvent.getDataContentType())
+        final byte[] bodyByte = Objects.requireNonNull(EventFormatProvider.getInstance().resolveFormat(cloudEvent.getDataContentType()))
             .serialize(cloudEvent);
         final String content = new String(bodyByte, StandardCharsets.UTF_8);
 


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@eventmesh.apache.org
For additional commands, e-mail: commits-help@eventmesh.apache.org