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

mytang0 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 e3c065769 fixes #3253
     new 7ec90de63 Merge pull request #3332 from nikam14/patch-8
e3c065769 is described below

commit e3c065769b46f45d8ef4b6324388460ff091cdd3
Author: maheshnikam <[email protected]>
AuthorDate: Fri Mar 3 08:11:24 2023 +0000

    fixes #3253
    
    Added null pointer exception.
---
 .../resolver/http/SendMessageBatchV2ProtocolResolver.java            | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git 
a/eventmesh-protocol-plugin/eventmesh-protocol-cloudevents/src/main/java/org/apache/eventmesh/protocol/cloudevents/resolver/http/SendMessageBatchV2ProtocolResolver.java
 
b/eventmesh-protocol-plugin/eventmesh-protocol-cloudevents/src/main/java/org/apache/eventmesh/protocol/cloudevents/resolver/http/SendMessageBatchV2ProtocolResolver.java
index 804398526..c436ac15c 100644
--- 
a/eventmesh-protocol-plugin/eventmesh-protocol-cloudevents/src/main/java/org/apache/eventmesh/protocol/cloudevents/resolver/http/SendMessageBatchV2ProtocolResolver.java
+++ 
b/eventmesh-protocol-plugin/eventmesh-protocol-cloudevents/src/main/java/org/apache/eventmesh/protocol/cloudevents/resolver/http/SendMessageBatchV2ProtocolResolver.java
@@ -28,6 +28,7 @@ import 
org.apache.eventmesh.protocol.api.exception.ProtocolHandleException;
 import org.apache.commons.lang3.StringUtils;
 
 import java.nio.charset.StandardCharsets;
+import java.util.Objects;
 
 import io.cloudevents.CloudEvent;
 import io.cloudevents.SpecVersion;
@@ -62,7 +63,7 @@ public class SendMessageBatchV2ProtocolResolver {
 
             CloudEvent event = null;
             if (StringUtils.equals(SpecVersion.V1.toString(), 
protocolVersion)) {
-                event = 
EventFormatProvider.getInstance().resolveFormat(JsonFormat.CONTENT_TYPE)
+                event = 
Objects.requireNonNull(EventFormatProvider.getInstance().resolveFormat(JsonFormat.CONTENT_TYPE))
                     .deserialize(content.getBytes(StandardCharsets.UTF_8));
                 event = CloudEventBuilder.from(event)
                     .withExtension(ProtocolKey.REQUEST_CODE, code)
@@ -81,7 +82,7 @@ public class SendMessageBatchV2ProtocolResolver {
                     
.withExtension(SendMessageBatchV2RequestBody.PRODUCERGROUP, producerGroup)
                     .build();
             } else if (StringUtils.equals(SpecVersion.V03.toString(), 
protocolVersion)) {
-                event = 
EventFormatProvider.getInstance().resolveFormat(JsonFormat.CONTENT_TYPE)
+                event = 
Objects.requireNonNull(EventFormatProvider.getInstance().resolveFormat(JsonFormat.CONTENT_TYPE))
                     .deserialize(content.getBytes(StandardCharsets.UTF_8));
                 event = CloudEventBuilder.from(event)
                     .withExtension(ProtocolKey.REQUEST_CODE, code)


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to