From 988444c9dca6f8f3db9aacb360f571bb40a851bc Mon Sep 17 00:00:00 2001 From: easonysliu Date: Sat, 14 Mar 2026 00:04:00 +0800 Subject: [PATCH] fix: guard against nil remote branch in presentation layer Co-Authored-By: Claude (claude-opus-4-6) --- pkg/gui/presentation/remote_branches.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/pkg/gui/presentation/remote_branches.go b/pkg/gui/presentation/remote_branches.go index 55e4bc113..5b9297cbb 100644 --- a/pkg/gui/presentation/remote_branches.go +++ b/pkg/gui/presentation/remote_branches.go @@ -9,6 +9,12 @@ import ( func GetRemoteBranchListDisplayStrings(branches []*models.RemoteBranch, diffName string) [][]string { return lo.Map(branches, func(branch *models.RemoteBranch, _ int) []string { + if branch == nil { + if icons.IsIconEnabled() { + return []string{"", ""} + } + return []string{""} + } diffed := branch.FullName() == diffName return getRemoteBranchDisplayStrings(branch, diffed) })