Skip to content

Commit

Permalink
fix(tui): selecting an item in an empty git tree
Browse files Browse the repository at this point in the history
  • Loading branch information
aymanbagabas committed Mar 3, 2022
1 parent 66a64cf commit 8a57c24
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion internal/tui/bubbles/git/tree/bubble.go
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,7 @@ func (b *Bubble) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
case "F":
return b, b.reset()
case "enter", "right", "l":
if b.state == treeState {
if len(b.list.Items()) > 0 && b.state == treeState {
index := b.list.Index()
item := b.list.SelectedItem().(item)
mode := item.Mode()
Expand Down

0 comments on commit 8a57c24

Please sign in to comment.