nieomylnieja/go-libyear

Panic when running

Closed this issue · 1 comments

I got the panic bellow on two projects.
Now both of those projects use cgo and a modules in private repositories in go.mod. Bu I'm pretty sure that the modules in private repositories are at fault as I have another project without cgo but with modules in private repository.

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

goroutine 38 [running]:
github.com/nieomylnieja/go-libyear/internal.(*GitHandler).listAllTags(0x0?, 0xc000224040?)
	/srv/go/pkg/mod/github.com/nieomylnieja/go-libyear@v0.4.0/internal/git_handler.go:194 +0x1d
github.com/nieomylnieja/go-libyear/internal.(*GitHandler).GetInfo(0xc000194040, {0xc000224040, 0x1b}, 0xc000256190)
	/srv/go/pkg/mod/github.com/nieomylnieja/go-libyear@v0.4.0/internal/git_handler.go:143 +0x4f
github.com/nieomylnieja/go-libyear.Command.runForModule({{0x8acc80, 0xc00020a300}, {0x8acce0, 0xb95a80}, {0x8afd98, 0xc0002120b0}, {0x8acec0, 0xc000222000}, 0x0, 0xc000220090, ...}, ...)
	/srv/go/pkg/mod/github.com/nieomylnieja/go-libyear@v0.4.0/command.go:119 +0x122
github.com/nieomylnieja/go-libyear.Command.Run.func2()
	/srv/go/pkg/mod/github.com/nieomylnieja/go-libyear@v0.4.0/command.go:75 +0x3b
golang.org/x/sync/errgroup.(*Group).Go.func1()
	/srv/go/pkg/mod/golang.org/x/sync@v0.6.0/errgroup/errgroup.go:78 +0x56
created by golang.org/x/sync/errgroup.(*Group).Go in goroutine 1
	/srv/go/pkg/mod/golang.org/x/sync@v0.6.0/errgroup/errgroup.go:75 +0x96

Thanks for reporting the issue @mvrhov and thanks @Crocmagnon for fixing it :)
I will release v0.4.2 today with these fixes.