Handle store closed exception

This commit is contained in:
M66B 2020-09-20 10:10:31 +02:00
parent 60534ae045
commit 8a9be94fc6
1 changed files with 10 additions and 1 deletions

View File

@ -1325,7 +1325,16 @@ public class ServiceSynchronize extends ServiceBase implements SharedPreferences
db.folder().setFolderState(folder.id, "connecting");
ifolder = iservice.getStore().getFolder(folder.name);
// Handle store closed exception
try {
ifolder = iservice.getStore().getFolder(folder.name);
} catch (IllegalStateException ex) {
if ("Not connected".equals(ex.getMessage()))
return;
else
throw ex;
}
try {
ifolder.open(Folder.READ_WRITE);
} catch (ReadOnlyFolderException ex) {