Description
Describe the bug
In a new repository without any remotes configured, pressing ENTER in the empty branch list leads to panic (index out of bounds).
To Reproduce
Steps to reproduce the behavior:
- Create a new repository
- start gitui
- Press
b
to bring up branch selection - Press
TAB
to switch to remote branch list - Press
ENTER
Expected behavior
Application does not crash
Details
panic: PanicInfo { payload: Any, message: Some(index out of bounds: the len is 0 but the index is 0), location: Location { file: "src/components/branchlist.rs", line: 445, col: 18 } } trace: 0: backtrace::capture::Backtrace::new 1: gitui::set_panic_handlers::{{closure}} 2: std::panicking::rust_panic_with_hook 3: std::panicking::begin_panic_handler::{{closure}} 4: std::sys_common::backtrace::__rust_end_short_backtrace 5: _rust_begin_unwind 6: core::panicking::panic_fmt 7: core::panicking::panic_bounds_check 8: <alloc::vec::Vec<T,A> as core::ops::index::Index<I>>::index 9: <gitui::components::branchlist::BranchListComponent as gitui::components::Component>::event 10: gitui::components::event_pump 11: gitui::main 12: std::sys_common::backtrace::__rust_begin_short_backtrace 13: _main
Context (please complete the following information):
- OS/Distro + Version:
macOS 11.2.3
- GitUI Version:
0.14.0
Activity