Skip to content

Commit a5755be

Browse files
committed
🐛 fix panic when pressing enter with no item selected
1 parent 7cbac54 commit a5755be

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/input_handler.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,11 @@ pub fn handle_inputs(app: &mut App) -> Result<(), Box<dyn std::error::Error>> {
1818
KeyCode::Up => app.change_selected_item(false),
1919
KeyCode::PageDown => app.scroll_config_paragraph(1),
2020
KeyCode::PageUp => app.scroll_config_paragraph(-1),
21-
KeyCode::Enter => app.should_spawn_ssh = true,
21+
KeyCode::Enter => {
22+
if app.get_selected_item().is_some() {
23+
app.should_spawn_ssh = true;
24+
}
25+
}
2226
_ => {}
2327
};
2428
}

0 commit comments

Comments
 (0)