Fix panic when using multi-level key mapping

pull/924/head
Nehliin 2021-10-16 15:22:28 +02:00 committed by Blaž Hrastnik
parent 5501669f8c
commit fbba47fbc0
1 changed files with 1 additions and 1 deletions

View File

@ -140,7 +140,7 @@ impl KeyTrieNode {
}
}
body.sort_unstable_by_key(|(_, keys)| {
self.order.iter().position(|&k| k == keys[0]).unwrap()
self.order.iter().position(|&k| k == keys[0]).unwrap_or(0)
});
let prefix = format!("{} ", self.name());
if body.iter().all(|(desc, _)| desc.starts_with(&prefix)) {