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

Fix a crash that occurred when pressing enter on an empty commit, reflog, or stash panel #1914

Merged

Conversation

Ryooooooga
Copy link
Contributor

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

goroutine 1 [running]:
github.com/jesseduffield/lazygit/pkg/commands/models.(*StashEntry).RefName(...)
        /Users/XXX/repos/github.com/Ryooooooga/lazygit/pkg/commands/models/stash_entry.go:12
github.com/jesseduffield/lazygit/pkg/commands/models.(*StashEntry).Description(0x0)
        /Users/XXX/repos/github.com/Ryooooooga/lazygit/pkg/commands/models/stash_entry.go:24 +0x23
github.com/jesseduffield/lazygit/pkg/gui.(*Gui).SwitchToCommitFilesContext(0xc0001ca240, {{0x18c3320, 0x0}, 0x0, {0x18c94f8, 0xc000200a90}})
        /Users/XXX/repos/github.com/Ryooooooga/lazygit/pkg/gui/commit_files_panel.go:44 +0xa8
github.com/jesseduffield/lazygit/pkg/gui/controllers.(*SwitchToDiffFilesController).enter(0xc0002064c0, {0x18c3320, 0x0})
        /Users/XXX/repos/github.com/Ryooooooga/lazygit/pkg/gui/controllers/switch_to_diff_files_controller.go:65 +0xbf
github.com/jesseduffield/lazygit/pkg/gui/controllers.(*SwitchToDiffFilesController).checkSelected.func1()
        /Users/XXX/repos/github.com/Ryooooooga/lazygit/pkg/gui/controllers/switch_to_diff_files_controller.go:60 +0x3e
github.com/jesseduffield/lazygit/pkg/gui.(*Gui).SetKeybinding.func2(0x1045893?, 0x1037176?)
        /Users/XXX/repos/github.com/Ryooooooga/lazygit/pkg/gui/keybindings.go:924 +0x1b
github.com/jesseduffield/gocui.(*Gui).execKeybinding(0xc0003d9800?, 0x10466ef?, 0xc0003d9850?)
        /Users/XXX/repos/github.com/Ryooooooga/lazygit/vendor/github.com/jesseduffield/gocui/gui.go:1302 +0x59
github.com/jesseduffield/gocui.(*Gui).execKeybindings(0xc0001e4000, 0xc000000b40, 0xc0003d9870)
        /Users/XXX/repos/github.com/Ryooooooga/lazygit/vendor/github.com/jesseduffield/gocui/gui.go:1270 +0x530
github.com/jesseduffield/gocui.(*Gui).onKey(0xc000206110?, 0xc000152300?)
        /Users/XXX/repos/github.com/Ryooooooga/lazygit/vendor/github.com/jesseduffield/gocui/gui.go:1146 +0xf1
github.com/jesseduffield/gocui.(*Gui).handleEvent(0xc0003d9850?, 0xc0003d9840?)
        /Users/XXX/repos/github.com/Ryooooooga/lazygit/vendor/github.com/jesseduffield/gocui/gui.go:697 +0x45
github.com/jesseduffield/gocui.(*Gui).MainLoop(0xc0001e4000)
        /Users/XXX/repos/github.com/Ryooooooga/lazygit/vendor/github.com/jesseduffield/gocui/gui.go:657 +0x225
github.com/jesseduffield/lazygit/pkg/gui.(*Gui).Run(0xc0001ca240, {0x0, 0x0})
        /Users/XXX/repos/github.com/Ryooooooga/lazygit/pkg/gui/gui.go:596 +0x696
github.com/jesseduffield/lazygit/pkg/gui.(*Gui).RunAndHandleError.func1()
        /Users/XXX/repos/github.com/Ryooooooga/lazygit/pkg/gui/gui.go:717 +0x3c
github.com/jesseduffield/lazygit/pkg/utils.SafeWithError(0x0?)
        /Users/XXX/repos/github.com/Ryooooooga/lazygit/pkg/utils/utils.go:115 +0x67
github.com/jesseduffield/lazygit/pkg/gui.(*Gui).RunAndHandleError(0xc0001ca240, {0x0, 0x0})
        /Users/XXX/repos/github.com/Ryooooooga/lazygit/pkg/gui/gui.go:716 +0x8f
github.com/jesseduffield/lazygit/pkg/app.(*App).Run(0xc0001328a0, {0x0, 0x0})
        /Users/XXX/repos/github.com/Ryooooooga/lazygit/pkg/app/app.go:254 +0xa5
main.main()
        /Users/XXX/repos/github.com/Ryooooooga/lazygit/main.go:144 +0xe66

@jesseduffield
Copy link
Owner

Classic Go haha. Nice one!

@jesseduffield jesseduffield merged commit 8c6260e into jesseduffield:master May 5, 2022
@Ryooooooga Ryooooooga deleted the feature/fix-crash-empty-panel branch May 5, 2022 23:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants