mirror of
https://github.com/chatmail/core.git
synced 2026-05-08 17:36:29 +03:00
do not panic on missing or wrong formatted values in the database
This commit is contained in:
@@ -99,7 +99,9 @@ impl Context {
|
|||||||
}
|
}
|
||||||
|
|
||||||
pub fn get_config_int(&self, key: Config) -> i32 {
|
pub fn get_config_int(&self, key: Config) -> i32 {
|
||||||
self.get_config(key).and_then(|s| s.parse().ok()).unwrap()
|
self.get_config(key)
|
||||||
|
.and_then(|s| s.parse().ok())
|
||||||
|
.unwrap_or_default()
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn get_config_bool(&self, key: Config) -> bool {
|
pub fn get_config_bool(&self, key: Config) -> bool {
|
||||||
|
|||||||
Reference in New Issue
Block a user