From bd9bd8938964f8454b41653902b66b43f7afea2d Mon Sep 17 00:00:00 2001 From: M66B Date: Thu, 16 Jun 2022 10:33:14 +0200 Subject: [PATCH] Improved compose/attachment error handling --- app/src/main/java/eu/faircode/email/FragmentCompose.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/eu/faircode/email/FragmentCompose.java b/app/src/main/java/eu/faircode/email/FragmentCompose.java index 86be826bc1..12edc22c17 100644 --- a/app/src/main/java/eu/faircode/email/FragmentCompose.java +++ b/app/src/main/java/eu/faircode/email/FragmentCompose.java @@ -4427,7 +4427,7 @@ public class FragmentCompose extends FragmentBase { // Reset progress on failure Log.e(ex); db.attachment().setError(attachment.id, Log.formatThrowable(ex, false)); - throw ex; + return null; } return attachment; @@ -5425,7 +5425,7 @@ public class FragmentCompose extends FragmentBase { if (last_attachments != null) for (EntityAttachment attachment : last_attachments) - if (!attachment.available && attachment.progress == null) + if (!attachment.available && attachment.progress == null && attachment.error == null) EntityOperation.queue(context, data.draft, EntityOperation.ATTACHMENT, attachment.id); db.setTransactionSuccessful();