chelnak / gh-changelog

A gh cli extension that will make your changelogs ✨
MIT License
109 stars 4 forks source link

Fix get latest panic on single entry changelog #151

Closed h0tw1r3 closed 3 months ago

h0tw1r3 commented 3 months ago
$ gh-changelog get --latest
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x10 pc=0xafc65d]

goroutine 1 [running]:
github.com/chelnak/gh-changelog/internal/get.changelogWithSingleEntry({0x0, 0x0, {0xc000512428, 0x6}, {0x0, 0x0}, {0x0, 0xeddc4ce80, 0x0}, {0x0, ...}, ...}, ...)
        /home/h0tw1r3/dev/gh-changelog/internal/get/get.go:31 +0x5d
github.com/chelnak/gh-changelog/internal/get.GetLatest({0xc000473340?, 0x0?})
        /home/h0tw1r3/dev/gh-changelog/internal/get/get.go:70 +0x10e
github.com/chelnak/gh-changelog/cmd.glob..func2(0x2354fc0?, {0xe2e32c?, 0x1?, 0x1?})
        /home/h0tw1r3/dev/gh-changelog/cmd/get.go:43 +0x67
github.com/spf13/cobra.(*Command).execute(0x2354fc0, {0xc000519d20, 0x1, 0x1})
        /home/h0tw1r3/dev/go/pkg/mod/github.com/spf13/cobra@v1.6.1/command.go:916 +0x862
github.com/spf13/cobra.(*Command).ExecuteC(0x2355860)
        /home/h0tw1r3/dev/go/pkg/mod/github.com/spf13/cobra@v1.6.1/command.go:1044 +0x3bd
github.com/spf13/cobra.(*Command).Execute(...)
        /home/h0tw1r3/dev/go/pkg/mod/github.com/spf13/cobra@v1.6.1/command.go:968
github.com/chelnak/gh-changelog/cmd.Execute()
        /home/h0tw1r3/dev/gh-changelog/cmd/root.go:93 +0x25
main.main()
        /home/h0tw1r3/dev/gh-changelog/main.go:10 +0x19
chelnak commented 3 months ago

Ahh yes fantastic. Good catch!

chelnak commented 3 months ago

I will cut another point release now!