mirror of
https://github.com/M66B/FairEmail.git
synced 2026-03-29 05:15:13 +02:00
Prevent crash
This commit is contained in:
@@ -391,13 +391,17 @@ public class ServiceSend extends ServiceBase {
|
||||
HtmlHelper.getPreview(body),
|
||||
parts.getWarnings(message.warning));
|
||||
|
||||
Long size = null;
|
||||
if (body != null)
|
||||
size = (long) body.length();
|
||||
|
||||
Long total = null;
|
||||
List<EntityAttachment> attachments = db.attachment().getAttachments(sid);
|
||||
for (EntityAttachment attachment : attachments)
|
||||
if (attachment.size != null)
|
||||
total = (total == null ? 0 : total) + attachment.size;
|
||||
|
||||
db.message().setMessageSize(sid, (long) body.length(), total);
|
||||
db.message().setMessageSize(sid, size, total);
|
||||
db.message().setMessageSent(sid, time);
|
||||
db.message().setMessageUiHide(sid, false);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user