Skip to content

Commit

Permalink
fix panic when no entries match query
Browse files Browse the repository at this point in the history
  • Loading branch information
BlockListed committed Oct 8, 2023
1 parent 811a435 commit cc863c2
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/mode/apps.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,12 @@ impl AppsMode {
}

pub fn eval(&mut self, info: EvalInfo<'_>) -> std::convert::Infallible {
let idx = info.index.unwrap();
let idx = if let Some(idx) = info.index {
idx
} else {
// No entries matched the user query.
std::process::exit(1);
};
let entry = &self.entries[idx];
let exec = if info.subindex == 0 {
&entry.entry.exec
Expand Down

0 comments on commit cc863c2

Please sign in to comment.