You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@camel.apache.org by "Claus Ibsen (Jira)" <ji...@apache.org> on 2025/11/28 16:07:00 UTC

[jira] [Commented] (CAMEL-22737) camel-as2: MimeEntity::parseEntityBody causes NPE for unsupported mime types

    [ https://issues.apache.org/jira/browse/CAMEL-22737?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18041339#comment-18041339 ] 

Claus Ibsen commented on CAMEL-22737:
-------------------------------------

Thanks for reporting.

You are welcome to send a PR

> camel-as2: MimeEntity::parseEntityBody causes NPE for unsupported mime types
> ----------------------------------------------------------------------------
>
>                 Key: CAMEL-22737
>                 URL: https://issues.apache.org/jira/browse/CAMEL-22737
>             Project: Camel
>          Issue Type: Bug
>          Components: camel-as2
>    Affects Versions: 4.16.0
>            Reporter: Jürgen Link
>            Priority: Minor
>
> When parsing an entity body with an unsupported type (e.g. application/octet-stream), the method parseEntityBody returns null. Some callers do an null check explicitly, while others don't (e.g. parseMultipartSignedEntityBody).
> This behavior leads to a NullPointerException, effectively hiding the root cause of the issue. I'd like to suggest to throw an 
> AS2DecryptionException({color:#008000}"Unsupported entity content type: " {color}+ entityContentType), instead of returning null in the default case.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)