From 0a828a739e10299605eaff72ffaf90a1908b54e8 Mon Sep 17 00:00:00 2001 From: smizrahi Date: Wed, 18 Dec 2024 10:39:27 +0100 Subject: [PATCH] fix(mail): Fix assertion when failed to decode base64 mime body mail part --- SoObjects/Mailer/SOGoMailObject.m | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/SoObjects/Mailer/SOGoMailObject.m b/SoObjects/Mailer/SOGoMailObject.m index 2906ee64b..aa010b308 100644 --- a/SoObjects/Mailer/SOGoMailObject.m +++ b/SoObjects/Mailer/SOGoMailObject.m @@ -953,7 +953,10 @@ static BOOL debugSoParts = NO; body = [NSData data]; currentAttachment = [NSMutableDictionary dictionaryWithDictionary: currentInfo]; - [currentAttachment setObject: body forKey: @"body"]; + if (body) + [currentAttachment setObject: body forKey: @"body"]; + else + [self errorWithFormat: @"Failed add attachement %@, empty body - failed to decode : %@", currentPath, currentInfo]; [attachments addObject: currentAttachment]; } }