haihuiyang opened a new issue, #1848:
URL: https://github.com/apache/incubator-eventmesh/issues/1848

   ### Search before asking
   
   - [X] I had searched in the 
[issues](https://github.com/apache/eventmesh/issues?q=is%3Aissue) and found no 
similar issues.
   
   
   ### Enhancement Request
   
       @Override
       public Optional<CloudEvent> handle(CloudEvent msg) {
           String content = new String(msg.getData().toBytes(), 
StandardCharsets.UTF_8);
           log.info("receive async msg: {}|{}", msg, content);
           return Optional.empty();
       }
   
   located at:
   org/apache/eventmesh/tcp/demo/sub/cloudevents/AsyncSubscribe.java line 71
   Add NPE to check for exceptions.
   
   ### Describe the solution you'd like
   
   msg.getData() 可能为 null,直接调用 toBytes 会有 NPE;
   在调用 toBytes 之前判断一下是否为空,如果为空,直接返回。
   
   ### Are you willing to submit PR?
   
   - [X] Yes I am willing to submit a PR!


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


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

Reply via email to