pull/170/head
M66B 6 years ago
parent 2508fcfa47
commit e9bceaf26b

@ -2148,8 +2148,7 @@ class Core {
int sequence = 1;
String autocrypt = helper.getAutocrypt();
if (autocrypt != null)
try {
if (autocrypt != null) {
EntityAttachment attachment = new EntityAttachment();
attachment.message = message.id;
attachment.sequence = sequence++;
@ -2158,6 +2157,7 @@ class Core {
attachment.disposition = Part.ATTACHMENT;
attachment.id = db.attachment().insertAttachment(attachment);
try {
byte[] b = Base64.decode(autocrypt, Base64.DEFAULT);
File file = attachment.getFile(context);
@ -2170,6 +2170,9 @@ class Core {
db.attachment().setDownloaded(attachment.id, file.length());
} catch (IllegalArgumentException ex) {
Log.w(ex);
db.attachment().setDownloaded(attachment.id, 0L);
db.attachment().setError(attachment.id, Log.formatThrowable(ex, false));
}
}
List<EntityAttachment> attachments = parts.getAttachments();

Loading…
Cancel
Save