From d69be5bb0b36a5a0362a344cc7c68c98229ca169 Mon Sep 17 00:00:00 2001 From: Manos Pitsidianakis Date: Fri, 13 Dec 2019 00:04:27 +0200 Subject: [PATCH] ui/accounts: don't panic if Backend::folders is_err --- ui/src/conf/accounts.rs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/ui/src/conf/accounts.rs b/ui/src/conf/accounts.rs index 109c8870..f20166cb 100644 --- a/ui/src/conf/accounts.rs +++ b/ui/src/conf/accounts.rs @@ -310,7 +310,13 @@ impl Account { fn init(&mut self) { let ref_folders: FnvHashMap = - self.backend.read().unwrap().folders().unwrap(); + match self.backend.read().unwrap().folders() { + Ok(f) => f, + Err(err) => { + debug!(&err); + return; + } + }; let mut folders: FnvHashMap = FnvHashMap::with_capacity_and_hasher(ref_folders.len(), Default::default()); let mut folders_order: Vec = Vec::with_capacity(ref_folders.len());