charmbracelet / soft-serve

The mighty, self-hostable Git server for the command line🍦
MIT License
5.26k stars 135 forks source link

Crashes when viewing commit logs #177

Closed yonas closed 1 year ago

yonas commented 1 year ago

Describe the bug Sometimes crashes when viewing commit logs.

To Reproduce Tab over to the commit log pane and try to view an individual commit.

Expected behavior Should not crash.

Screenshots

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

goroutine 1097 [running]:
github.com/gogs/git-module.(*Repository).Diff(0x8500d2e40, {0x8505e6180, 0x28}, 0x3e8, 0x3e8, 0x3e8, {0x0?, 0x0?, 0x0?})
        github.com/gogs/git-module/repo_diff.go:51 +0xa17
github.com/charmbracelet/soft-serve/git.(*Repository).Diff(0x8502216e0?, 0x2610c0?)
        github.com/charmbracelet/soft-serve/git/repo.go:150 +0x57
github.com/charmbracelet/soft-serve/config.(*Repo).Diff(0x8503f2dc0, 0x850022210)
        github.com/charmbracelet/soft-serve/config/git.go:132 +0x91
github.com/charmbracelet/soft-serve/ui/pages/repo.(*Log).loadDiffCmd(0x5f0fe0?)
        github.com/charmbracelet/soft-serve/ui/pages/repo/log.go:421 +0x29
github.com/charmbracelet/bubbletea.(*Program).StartReturningModel.func6.1()
        github.com/charmbracelet/bubbletea/tea.go:470 +0x33
created by github.com/charmbracelet/bubbletea.(*Program).StartReturningModel.func6
        github.com/charmbracelet/bubbletea/tea.go:468 +0x14d

Environment (please complete the following information):

aymanbagabas commented 1 year ago

Hi @yonas,

Thank you for reporting this. Looks like an issue with one of the dependencies used in Soft Serve. I've opened a PR here to fix this issue.

yonas commented 1 year ago

Thanks @aymanbagabas , it works! :partying_face: