fix(mail): Fix assertion when there is an empty image in the mail. Fixes #6035.

This commit is contained in:
smizrahi
2024-09-13 15:53:53 +02:00
parent 2da4aa8cb8
commit 59d48cb382

View File

@@ -722,12 +722,14 @@ static NSArray *infoKeys = nil;
if ([[mime encoding] isEqualToString: @"base64"] && contentId) {
if ([text rangeOfString: contentId].location != NSNotFound) {
lText = [text stringByReplacingOccurrencesOfString: contentId
if (nil != [[mime body] bytes]) {
lText = [text stringByReplacingOccurrencesOfString: contentId
withString: [NSString stringWithFormat: @"data:%@;base64,%@",
[[mime contentType] stringValue],
[NSString stringWithUTF8String: [[mime body] bytes]]]];
[self setText: lText];
[draft deleteAttachmentWithName: [draftFileAttachement objectForKey:@"filename"]];
[self setText: lText];
[draft deleteAttachmentWithName: [draftFileAttachement objectForKey:@"filename"]];
}
} else {
// This is an attachment with no CID in message body
if ([draft inReplyTo]) {