You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@eventmesh.apache.org by GitBox <gi...@apache.org> on 2022/10/27 07:39:08 UTC
[GitHub] [incubator-eventmesh] xwm1992 commented on a diff in pull request #1918: [ISSUE #1914] fix NPE bug [HttpProtocolAdaptor]
xwm1992 commented on code in PR #1918:
URL: https://github.com/apache/incubator-eventmesh/pull/1918#discussion_r1006508626
##########
eventmesh-protocol-plugin/eventmesh-protocol-http/src/main/java/org/apache/eventmesh/protocol/http/HttpProtocolAdaptor.java:
##########
@@ -95,8 +95,11 @@ public ProtocolTransportObject fromCloudEvent(CloudEvent cloudEvent) throws Prot
}
httpEventWrapper.setSysHeaderMap(sysHeaderMap);
// ce data
- Map<String, Object> dataContentMap = JsonUtils.deserialize(new String(cloudEvent.getData().toBytes(), Constants.DEFAULT_CHARSET),
+ String jsonStr = new String(cloudEvent.getData().toBytes(), Constants.DEFAULT_CHARSET);
Review Comment:
`cloudEvent.getData()` may due NPE, please check this return value, note the `jsonStr`
--
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: dev-unsubscribe@eventmesh.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@eventmesh.apache.org
For additional commands, e-mail: dev-help@eventmesh.apache.org