ui/accounts: don't panic if Backend::folders is_err

This commit is contained in:
Manos Pitsidianakis 2019-12-13 00:04:27 +02:00
parent 328b17a995
commit d69be5bb0b
No known key found for this signature in database
GPG Key ID: 73627C2F690DF710

View File

@ -310,7 +310,13 @@ impl Account {
fn init(&mut self) {
let ref_folders: FnvHashMap<FolderHash, Folder> =
self.backend.read().unwrap().folders().unwrap();
match self.backend.read().unwrap().folders() {
Ok(f) => f,
Err(err) => {
debug!(&err);
return;
}
};
let mut folders: FnvHashMap<FolderHash, MailboxEntry> =
FnvHashMap::with_capacity_and_hasher(ref_folders.len(), Default::default());
let mut folders_order: Vec<FolderHash> = Vec::with_capacity(ref_folders.len());