Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Nil pointer on *RemoteBranch.FullName #3521

Open
glensargent opened this issue Apr 23, 2024 · 0 comments
Open

Nil pointer on *RemoteBranch.FullName #3521

glensargent opened this issue Apr 23, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@glensargent
Copy link

Describe the bug
Lazygit panics due to nil pointer dereference. I'm happy to PR a change that makes the relevant function more defensive if need be, but i'm unfamiliar with the src so not sure where else I'd have to check

To Reproduce
Unfortunately not able to reproduce since I'm not exactly sure what caused it / what I did before hand.

Expected behavior
N/A

Screenshots
image

Version info:
commit=, build date=, build source=homebrew, version=0.41.0, os=darwin, arch=arm64, git version=2.39.3 (Apple Git-146)
git version 2.39.3 (Apple Git-146)

Additional context

panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x2 addr=0x10 pc=0x1049ff3b8]

goroutine 898521 [running]:
github.com/jesseduffield/lazygit/pkg/commands/models.(*RemoteBranch).FullName(0x140008bfec0?)
        github.com/jesseduffield/lazygit/pkg/commands/models/remote_branch.go:10 +0x18
github.com/jesseduffield/lazygit/pkg/gui/context.NewRemoteBranchesContext.func3.GetRemoteBranchListDisplayStrings.1(0x0, 0x140014f7e50?)
        github.com/jesseduffield/lazygit/pkg/gui/presentation/remote_branches.go:12 +0x30
github.com/samber/lo.Map[...]({0x140000bafa0?, 0x2, 0x104b76990}, 0x14001229c80?)
        github.com/samber/[email protected]/slice.go:29 +0x80
github.com/jesseduffield/lazygit/pkg/gui/presentation.GetRemoteBranchListDisplayStrings(...)
        github.com/jesseduffield/lazygit/pkg/gui/presentation/remote_branches.go:11
github.com/jesseduffield/lazygit/pkg/gui/context.NewRemoteBranchesContext.func3(0x10?, 0x1056a1c60?)
        github.com/jesseduffield/lazygit/pkg/gui/context/remote_branches_context.go:32 +0x98
github.com/jesseduffield/lazygit/pkg/gui/context.(*ListRenderer).renderLines(0x140001a9610, 0xffffffffffffffff, 0xffffffffffffffff)
        github.com/jesseduffield/lazygit/pkg/gui/context/list_renderer.go:88 +0x160
github.com/jesseduffield/lazygit/pkg/gui/context.(*ListContextTrait).HandleRender(0x140001a9600)
        github.com/jesseduffield/lazygit/pkg/gui/context/list_context_trait.go:96 +0x44
github.com/jesseduffield/lazygit/pkg/gui.(*Gui).postRefreshUpdate(0x14000294908, {0x10504fd28, 0x1400000e690})
        github.com/jesseduffield/lazygit/pkg/gui/view_helpers.go:139 +0x98
github.com/jesseduffield/lazygit/pkg/gui.(*guiCommon).PostRefreshUpdate(0x1400001e400?, {0x10504fd28?, 0x1400000e690?})
        github.com/jesseduffield/lazygit/pkg/gui/gui_common.go:33 +0x28
github.com/jesseduffield/lazygit/pkg/gui/controllers/helpers.(*RefreshHelper).refreshView(0x14000293280, {0x10504fd28, 0x1400000e690})
        github.com/jesseduffield/lazygit/pkg/gui/controllers/helpers/refresh_helper.go:732 +0x50
github.com/jesseduffield/lazygit/pkg/gui/controllers/helpers.(*RefreshHelper).refreshRemotes(0x14000293280)
        github.com/jesseduffield/lazygit/pkg/gui/controllers/helpers/refresh_helper.go:657 +0x1b0
github.com/jesseduffield/lazygit/pkg/gui/controllers/helpers.(*RefreshHelper).Refresh.func2.9()
        github.com/jesseduffield/lazygit/pkg/gui/controllers/helpers/refresh_helper.go:163 +0x20
github.com/jesseduffield/lazygit/pkg/gui/controllers/helpers.(*RefreshHelper).Refresh.func2.1.1({0x0?, 0x1049fd200?})
        github.com/jesseduffield/lazygit/pkg/gui/controllers/helpers/refresh_helper.go:108 +0x24
github.com/jesseduffield/gocui.(*Gui).onWorkerAux(0x1049fd0f0?, 0x140011b41b0?, {0x105043238?, 0x14000711100?})
        github.com/jesseduffield/[email protected]/gui.go:680 +0x6c
github.com/jesseduffield/gocui.(*Gui).OnWorker.func1()
        github.com/jesseduffield/[email protected]/gui.go:667 +0x34
created by github.com/jesseduffield/gocui.(*Gui).OnWorker in goroutine 898317
        github.com/jesseduffield/[email protected]/gui.go:666 +0x94
@glensargent glensargent added the bug Something isn't working label Apr 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant