twitchdev / twitch-cli

The official Twitch CLI to make developing on Twitch easier.
Apache License 2.0
604 stars 71 forks source link

[Bug] Twitch token subcommand fails with segmentation fault #289

Closed djavorszky closed 10 months ago

djavorszky commented 11 months ago

What is the problem?

Invoking the example command from the documentation, I'm getting an error

$ twitch token -u -s 'user:read:email user:edit'

Additional information

$ twitch version
twitch-cli/1.1.21

Operating System

Mac OS 14.0

Architecture Version (x86, x64, arm, etc)

arm (Apple Silicon M1 Pro)

Steps to reproduce

  1. Execute: twitch token -u -s 'user:read:email user:edit'

Relevant log output

No Client ID or Secret found in configuration. Triggering configuration now.
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x2 addr=0x0 pc=0x1028a957c]

goroutine 1 [running]:
github.com/twitchdev/twitch-cli/cmd.loginCmdRun(0x1400016d200?, {0x140001981e0, 0x0, 0x3})
    /go/src/github.com/twitchdev/twitch-cli/cmd/token.go:53 +0x18c
github.com/spf13/cobra.(*Command).execute(0x102faa780, {0x140001981b0, 0x3, 0x3})
    /go/pkg/mod/github.com/spf13/cobra@v1.1.3/command.go:852 +0x554
github.com/spf13/cobra.(*Command).ExecuteC(0x102faa500)
    /go/pkg/mod/github.com/spf13/cobra@v1.1.3/command.go:960 +0x310
github.com/spf13/cobra.(*Command).Execute(...)
    /go/pkg/mod/github.com/spf13/cobra@v1.1.3/command.go:897
github.com/twitchdev/twitch-cli/cmd.Execute()
    /go/src/github.com/twitchdev/twitch-cli/cmd/root.go:26 +0x24
main.main()
    /go/src/github.com/twitchdev/twitch-cli/main.go:54 +0x2fc