mirror of
https://github.com/M66B/FairEmail.git
synced 2024-12-25 09:17:58 +00:00
Check for store closed on getting folder
This commit is contained in:
parent
d369384d3c
commit
62d9d44431
2 changed files with 10 additions and 2 deletions
|
@ -144,7 +144,7 @@ class Core {
|
|||
private static final long FUTURE_RECEIVED = 30 * 24 * 3600 * 1000L; // milliseconds
|
||||
private static final int LOCAL_RETRY_MAX = 2;
|
||||
private static final long LOCAL_RETRY_DELAY = 5 * 1000L; // milliseconds
|
||||
private static final int TOTAL_RETRY_MAX = LOCAL_RETRY_MAX * 10;
|
||||
private static final int TOTAL_RETRY_MAX = LOCAL_RETRY_MAX * 5;
|
||||
|
||||
static void processOperations(
|
||||
Context context,
|
||||
|
|
|
@ -1326,7 +1326,15 @@ public class ServiceSynchronize extends ServiceBase implements SharedPreferences
|
|||
|
||||
db.folder().setFolderState(folder.id, "connecting");
|
||||
|
||||
ifolder = iservice.getStore().getFolder(folder.name);
|
||||
try {
|
||||
ifolder = iservice.getStore().getFolder(folder.name);
|
||||
} catch (IllegalStateException ex) {
|
||||
if ("Not connected".equals(ex.getMessage()))
|
||||
return; // Store closed
|
||||
else
|
||||
throw ex;
|
||||
}
|
||||
|
||||
try {
|
||||
ifolder.open(Folder.READ_WRITE);
|
||||
if (ifolder instanceof IMAPFolder)
|
||||
|
|
Loading…
Reference in a new issue