mirror of https://github.com/M66B/FairEmail.git
Check for store closed on getting folder
This commit is contained in:
parent
d369384d3c
commit
62d9d44431
|
@ -144,7 +144,7 @@ class Core {
|
||||||
private static final long FUTURE_RECEIVED = 30 * 24 * 3600 * 1000L; // milliseconds
|
private static final long FUTURE_RECEIVED = 30 * 24 * 3600 * 1000L; // milliseconds
|
||||||
private static final int LOCAL_RETRY_MAX = 2;
|
private static final int LOCAL_RETRY_MAX = 2;
|
||||||
private static final long LOCAL_RETRY_DELAY = 5 * 1000L; // milliseconds
|
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(
|
static void processOperations(
|
||||||
Context context,
|
Context context,
|
||||||
|
|
|
@ -1326,7 +1326,15 @@ public class ServiceSynchronize extends ServiceBase implements SharedPreferences
|
||||||
|
|
||||||
db.folder().setFolderState(folder.id, "connecting");
|
db.folder().setFolderState(folder.id, "connecting");
|
||||||
|
|
||||||
|
try {
|
||||||
ifolder = iservice.getStore().getFolder(folder.name);
|
ifolder = iservice.getStore().getFolder(folder.name);
|
||||||
|
} catch (IllegalStateException ex) {
|
||||||
|
if ("Not connected".equals(ex.getMessage()))
|
||||||
|
return; // Store closed
|
||||||
|
else
|
||||||
|
throw ex;
|
||||||
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
ifolder.open(Folder.READ_WRITE);
|
ifolder.open(Folder.READ_WRITE);
|
||||||
if (ifolder instanceof IMAPFolder)
|
if (ifolder instanceof IMAPFolder)
|
||||||
|
|
Loading…
Reference in New Issue