mirror of
https://github.com/zed-industries/zed.git
synced 2025-01-12 21:32:40 +00:00
branch_list: Ensure index is within list bounds.
Z-2630
This commit is contained in:
parent
c2ffd8975b
commit
9c150252aa
1 changed files with 3 additions and 1 deletions
|
@ -182,7 +182,9 @@ impl PickerDelegate for BranchListDelegate {
|
|||
|
||||
fn confirm(&mut self, cx: &mut ViewContext<Picker<Self>>) {
|
||||
let current_pick = self.selected_index();
|
||||
let current_pick = self.matches[current_pick].string.clone();
|
||||
let Some(current_pick) = self.matches.get(current_pick).map(|pick| pick.string.clone()) else {
|
||||
return;
|
||||
};
|
||||
cx.spawn(|picker, mut cx| async move {
|
||||
picker
|
||||
.update(&mut cx, |this, cx| {
|
||||
|
|
Loading…
Reference in a new issue