You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by "essobedo (via GitHub)" <gi...@apache.org> on 2023/08/29 11:05:58 UTC

[GitHub] [camel] essobedo commented on a diff in pull request #11229: CAMEL-19731 AS2: Fixed null pointer exception

essobedo commented on code in PR #11229:
URL: https://github.com/apache/camel/pull/11229#discussion_r1308650011


##########
components/camel-as2/camel-as2-api/src/main/java/org/apache/camel/component/as2/api/entity/EntityParser.java:
##########
@@ -444,52 +444,56 @@ public static void parseAS2MessageEntity(HttpMessage message) throws HttpExcepti
             try {
                 // Determine Content Type of Message
                 String contentTypeStr = HttpMessageUtils.getHeaderValue(message, AS2Header.CONTENT_TYPE);
-                ContentType contentType = ContentType.parse(contentTypeStr);
-
-                // Determine Charset
-                String charsetName = StandardCharsets.US_ASCII.name();
-                Charset charset = contentType.getCharset();
-                if (charset != null) {
-                    charsetName = charset.name();
-                }
+                if (contentTypeStr != null) {

Review Comment:
   Will it work too if we simply add `if (contentTypeStr == null) { return; }`?



-- 
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: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org