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

Crash on deleting a branch in combination with filtering #4179

Open
Krismix1 opened this issue Jan 17, 2025 · 0 comments
Open

Crash on deleting a branch in combination with filtering #4179

Krismix1 opened this issue Jan 17, 2025 · 0 comments
Labels
bug Something isn't working

Comments

@Krismix1
Copy link
Contributor

Describe the bug
Lazygit crashed with "invalid memory address or nil pointer dereference error" after deleting a branch and applying filtering.
It seems this was previously fixed in #3058, but it appeared again (I tested on commit 36918560, and it worked fine there).

To Reproduce
Steps to reproduce the behavior:

  1. Create a branch named "dummy"
  2. Focus branch list view
  3. Press /
  4. Type: dummy
  5. Press Enter, d, Enter

Expected behavior
I expected lazygit to continue and either redo the filter operation, or show all branches.

Screenshots
If applicable, add screenshots to help explain your problem.

Version info:
lazygit: commit=v0.45.0, build date=2025-01-11T10:02:55Z, build source=binaryRelease, version=0.45.0, os=linux, arch=amd64, git version=2.48.1
git version 2.48.1

Additional context

panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x8 pc=0x583685225cd2]

goroutine 325 [running]:
github.com/jesseduffield/lazygit/pkg/gui/controllers/helpers.(*RefreshHelper).refreshBranches.func3(0x5836851883c5?)
        github.com/jesseduffield/lazygit/pkg/gui/controllers/helpers/refresh_helper.go:495 +0x12
github.com/samber/lo.FindIndexOf[...]({0xc001a920c0?, 0x1, 0xc001a90000}, 0xc001613e50?)
        github.com/samber/[email protected]/find.go:54 +0x57
github.com/jesseduffield/lazygit/pkg/gui/controllers/helpers.(*RefreshHelper).refreshBranches(0xc00074a680, 0x0, 0x0, 0x1)
        github.com/jesseduffield/lazygit/pkg/gui/controllers/helpers/refresh_helper.go:494 +0x707
github.com/jesseduffield/lazygit/pkg/gui/controllers/helpers.(*RefreshHelper).refreshReflogAndBranches(0xc00074a680, 0x0, 0x0)
        github.com/jesseduffield/lazygit/pkg/gui/controllers/helpers/refresh_helper.go:273 +0x74
github.com/jesseduffield/lazygit/pkg/gui/controllers/helpers.(*RefreshHelper).Refresh.func2.2()
        github.com/jesseduffield/lazygit/pkg/gui/controllers/helpers/refresh_helper.go:130 +0x1f
github.com/jesseduffield/lazygit/pkg/gui/controllers/helpers.(*RefreshHelper).Refresh.func2.1.1({0x0?, 0x0?})
        github.com/jesseduffield/lazygit/pkg/gui/controllers/helpers/refresh_helper.go:107 +0x13
github.com/jesseduffield/gocui.(*Gui).onWorkerAux(0xc0003661c0, 0x0?, {0x5836856e1638?, 0xc00007b260?})
        github.com/jesseduffield/[email protected]/gui.go:701 +0x65
github.com/jesseduffield/gocui.(*Gui).OnWorker.func1()
        github.com/jesseduffield/[email protected]/gui.go:688 +0x2b
created by github.com/jesseduffield/gocui.(*Gui).OnWorker in goroutine 225
        github.com/jesseduffield/[email protected]/gui.go:687 +0x92

Note: please try updating to the latest version or manually building the latest master to see if the issue still occurs.
I tried compiling from master. The issue persists

@Krismix1 Krismix1 added the bug Something isn't working label Jan 17, 2025
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