knqyf263/pet

[bug] invalid memory address or nil pointer dereference

deadc0de6 opened this issue · 1 comments

Hello,

I encountered the following bug when using pet with pet sync

version: pet version 0.4.0

It is reproductible

github.com/knqyf263/pet/sync.GitLabClient.GetSnippet({0xc000111c00, 0x96547d})
	/home/runner/work/pet/pet/sync/gitlab.go:104 +0x146
github.com/knqyf263/pet/sync.AutoSync({0xc000028360, 0x24})
	/home/runner/work/pet/pet/sync/sync.go:33 +0x5f
github.com/knqyf263/pet/cmd.sync(0xcf7b40, {0x94cc0b, 0x0, 0x0})
	/home/runner/work/pet/pet/cmd/sync.go:18 +0x27
github.com/spf13/cobra.(*Command).execute(0xcf7b40, {0xd2de58, 0x0, 0x0})
	/home/runner/go/pkg/mod/github.com/spf13/cobra@v0.0.3/command.go:762 +0x60e
github.com/spf13/cobra.(*Command).ExecuteC(0xcf7420)
	/home/runner/go/pkg/mod/github.com/spf13/cobra@v0.0.3/command.go:852 +0x2dc
github.com/spf13/cobra.(*Command).Execute(...)
	/home/runner/go/pkg/mod/github.com/spf13/cobra@v0.0.3/command.go:800
github.com/knqyf263/pet/cmd.Execute()
	/home/runner/work/pet/pet/cmd/root.go:48 +0x25
main.main()
	/home/runner/work/pet/pet/main.go:20 +0x17

I was missing the url = "https://gitlab.com" in the config file, my bad.