File tree 1 file changed +4
-3
lines changed
src/main/java/org/simplejavamail/converter/internal/mimemessage
1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -448,10 +448,11 @@ public static String parseMessageId(@Nonnull final MimeMessage mimeMessage) {
448
448
}
449
449
450
450
private static void moveInvalidEmbeddedResourcesToAttachments (ParsedMimeMessageComponents parsedComponents ) {
451
- final String htmlContent = parsedComponents .htmlContent . toString () ;
451
+ final String htmlContent = parsedComponents .htmlContent ;
452
452
for (Map .Entry <String , DataSource > cidEntry : parsedComponents .cidMap .entrySet ()) {
453
- if (!htmlContent .contains ("cid:" + extractCID (cidEntry .getKey ()))) {
454
- parsedComponents .attachmentList .put (cidEntry .getKey (), cidEntry .getValue ());
453
+ String cid = extractCID (cidEntry .getKey ());
454
+ if (htmlContent == null || !htmlContent .contains ("cid:" + cid )) {
455
+ parsedComponents .attachmentList .put (cid , cidEntry .getValue ());
455
456
parsedComponents .cidMap .remove (cidEntry .getKey ());
456
457
}
457
458
}
You can’t perform that action at this time.
0 commit comments