Skip to content

Commit

Permalink
avoid exception if inline image has no / an empty mime type
Browse files Browse the repository at this point in the history
  • Loading branch information
j-dimension committed Jan 17, 2024
1 parent 61ad598 commit 654d9ee
Showing 1 changed file with 6 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -911,9 +911,12 @@ public static ArrayList<String> getAttachmentNames(Object partObject) throws Exc
if (disposition == null) {
MimeBodyPart mimePart = (MimeBodyPart) part;

if (mimePart.getContent() instanceof Multipart) {
attachmentNames.addAll(getAttachmentNames(mimePart.getContent()));

try {
if (mimePart.getContent() instanceof Multipart) {
attachmentNames.addAll(getAttachmentNames(mimePart.getContent()));
}
} catch (Throwable t) {
log.warn("Unable to detect attachment names for mime part - is the mime type information empty?");
}

} else if (Part.ATTACHMENT.equalsIgnoreCase(disposition)) {
Expand Down

0 comments on commit 654d9ee

Please sign in to comment.