Check for store closed on getting folder

This commit is contained in:
M66B 2020-09-22 08:37:25 +02:00
parent d369384d3c
commit 62d9d44431
2 changed files with 10 additions and 2 deletions

View File

@ -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,

View File

@ -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)