diff --git a/src/conf/shortcuts.rs b/src/conf/shortcuts.rs index 031b08787..6c40ee74b 100644 --- a/src/conf/shortcuts.rs +++ b/src/conf/shortcuts.rs @@ -27,9 +27,9 @@ use melib::{MeliError, Result}; #[macro_export] macro_rules! shortcut { ($key:ident == $shortcuts:ident[$section:expr][$val:literal]) => { - $shortcuts[$section] - .get($val) - .map(|v| v == $key) + $shortcuts + .get($section) + .and_then(|s| s.get($val).map(|v| v == $key)) .unwrap_or(false) }; }