From 3ab9089e5fd6c51c08c7fee8f889425db0fe3eb4 Mon Sep 17 00:00:00 2001 From: M66B Date: Tue, 17 Nov 2020 10:25:26 +0100 Subject: [PATCH] Check if folder open on exception --- app/src/main/java/eu/faircode/email/Core.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/eu/faircode/email/Core.java b/app/src/main/java/eu/faircode/email/Core.java index dc3fa505f7..70b688e641 100644 --- a/app/src/main/java/eu/faircode/email/Core.java +++ b/app/src/main/java/eu/faircode/email/Core.java @@ -461,14 +461,15 @@ class Core { db.endTransaction(); } + if (ifolder != null && !ifolder.isOpen()) + break; + if (op.tries >= TOTAL_RETRY_MAX || ex instanceof OutOfMemoryError || ex instanceof FileNotFoundException || ex instanceof FolderNotFoundException || ex instanceof IllegalArgumentException || ex instanceof SQLiteConstraintException || - (ex instanceof IllegalStateException && - EntityOperation.SYNC.equals(op.name)) || (!ConnectionHelper.isIoError(ex) && (ex.getCause() instanceof BadCommandException || ex.getCause() instanceof CommandFailedException /* NO */)) ||