-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
Comments
I tested this with your reproduction steps, and it didn't crash for me. The filtered list of branches was empty for me after deleting the branch. Does this happen for you every time, or only sometimes? Maybe it's somehow timing sensitive. |
Hey @stefanhaller , I ended up firing a debugger and I think I can see why it happens/how to reproduce: in the unfiltered view, take note of the branch that is last in the list. Now filter the list, select the branch and delete it. Let me know if it reproduces with this approach. It's easier to reproduce if you only have 2 branches in the repo. You don't necessarily need to delete the last branch from the unfiltered view. You just have to ensure the last branch is present in the filtered view. |
Yes, I can easily reproduce it by filtering down to just the last branch in the list and trying to delete that. I'll see if I can come up with a fix tomorrow. |
Here's a possible fix: #4195. It's a draft PR for now because I didn't get around to adding a test yet. |
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:
/
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
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
The text was updated successfully, but these errors were encountered: