jesseduffield / jesseduffield/lazygit
Nil pointer panic in GetRemoteBranchListDisplayStrings
Open
- Dominant language
- Go
- Stars
- 82.4k
- Forks
- 3k
- Avg merge
- 2d 18h
- Merged PRs (30d)
- 19
Description
Hi,
I've been looking at the crash reported in #5240 and traced it to `pkg/gui/presentation/remote_branches.go`. The `GetRemoteBranchListDisplayStrings` function doesn't guard against nil elements in the `branches` slice before calling `branch.FullName()`.
This can happen during a race between remote editing/refreshing — when the remote list is updated concurrently, stale branch pointers can end up as nil in the slice.
A simple nil check before accessing the branch would prevent the panic.
Contributor guide
Assessment
This issue has not been assessed yet.