Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pressing enter in empty remote branch list leads to panic #643

Closed
eriksixt opened this issue Apr 14, 2021 · 0 comments · Fixed by #644
Closed

Pressing enter in empty remote branch list leads to panic #643

eriksixt opened this issue Apr 14, 2021 · 0 comments · Fixed by #644
Labels
bug Something isn't working

Comments

@eriksixt
Copy link

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:

  1. Create a new repository
  2. start gitui
  3. Press b to bring up branch selection
  4. Press TAB to switch to remote branch list
  5. 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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants