From 8a57c24eae4fa763d1e586091e06ea8930181e82 Mon Sep 17 00:00:00 2001 From: Ayman Bagabas Date: Wed, 2 Mar 2022 16:48:47 -0500 Subject: [PATCH] fix(tui): selecting an item in an empty git tree --- internal/tui/bubbles/git/tree/bubble.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/tui/bubbles/git/tree/bubble.go b/internal/tui/bubbles/git/tree/bubble.go index 1a7be03f1..94c4b43ea 100644 --- a/internal/tui/bubbles/git/tree/bubble.go +++ b/internal/tui/bubbles/git/tree/bubble.go @@ -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()