do not panic on missing or wrong formatted values in the database

This commit is contained in:
B. Petersen
2019-10-03 16:55:12 +02:00
parent c6b2d640ae
commit 23d2d87c24

View File

@@ -99,7 +99,9 @@ impl Context {
}
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 {