dlvhdr / gh-dash

A beautiful CLI dashboard for GitHub 🚀
https://dlvhdr.github.io/gh-dash
MIT License
6.82k stars 195 forks source link

[BUG] panic #307

Closed public-rant closed 10 months ago

public-rant commented 10 months ago

Describe the bug

gh dash produced this error

Caught panic:

runtime error: invalid memory address or nil pointer dereference

Restoring terminal...

goroutine 1 [running]:
runtime/debug.Stack()
        /opt/hostedtoolcache/go/1.20.7/x64/src/runtime/debug/stack.go:24 +0x64
runtime/debug.PrintStack()
        /opt/hostedtoolcache/go/1.20.7/x64/src/runtime/debug/stack.go:16 +0x1c
github.com/charmbracelet/bubbletea.(*Program).Run.func1()
        /home/runner/go/pkg/mod/github.com/charmbracelet/bubbletea@v0.24.2/tea.go:440 +0x8c
panic({0x1036cf980, 0x103cc3f40})
        /opt/hostedtoolcache/go/1.20.7/x64/src/runtime/panic.go:890 +0x258
github.com/dlvhdr/gh-dash/ui/theme.ParseTheme(_)
        /home/runner/work/gh-dash/gh-dash/ui/theme/theme.go:40 +0x38
github.com/dlvhdr/gh-dash/ui.Model.Update({{{0x0, 0x0}, {{0x140003c2ba0, 0x2, 0x2}, {{...}, {...}}, 0x0}, {{0x140003c2bc0, 0x2, ...}, ...}, ...}, ...}, ...)
        /home/runner/work/gh-dash/gh-dash/ui/ui.go:323 +0x2b68
github.com/charmbracelet/bubbletea.(*Program).eventLoop(0x1400018a600, {0x103765d00?, 0x140001b9400?}, 0x102cf2858?)
        /home/runner/go/pkg/mod/github.com/charmbracelet/bubbletea@v0.24.2/tea.go:373 +0x5d8
github.com/charmbracelet/bubbletea.(*Program).Run(0x1400018a600)
        /home/runner/go/pkg/mod/github.com/charmbracelet/bubbletea@v0.24.2/tea.go:503 +0x74c
github.com/dlvhdr/gh-dash/cmd.init.0.func1(0x103ccef60?, {0x1033dc1bd?, 0x0?, 0x0?})
        /home/runner/work/gh-dash/gh-dash/cmd/root.go:131 +0x2b8
github.com/spf13/cobra.(*Command).execute(0x103ccef60, {0x1400001e240, 0x0, 0x0})
        /home/runner/go/pkg/mod/github.com/spf13/cobra@v1.7.0/command.go:944 +0x5b0
github.com/spf13/cobra.(*Command).ExecuteC(0x103ccef60)
        /home/runner/go/pkg/mod/github.com/spf13/cobra@v1.7.0/command.go:1068 +0x35c
github.com/spf13/cobra.(*Command).Execute(...)
        /home/runner/go/pkg/mod/github.com/spf13/cobra@v1.7.0/command.go:992
github.com/dlvhdr/gh-dash/cmd.Execute()
        /home/runner/work/gh-dash/gh-dash/cmd/root.go:41 +0x28
main.main()
        /home/runner/work/gh-dash/gh-dash/gh-dash.go:8 +0x1c

To Reproduce

Worked fine on fresh install. After running gh dash -c /path/to/config.yml, kaput.

After removing and re-installing, the issue persists.

Expected behavior

It should work as expected...

Screenshots N/A

Desktop (please complete the following information): macOS 13.5.1

dlvhdr commented 10 months ago

Can you paste your config?

public-rant commented 10 months ago

Ok, so. If I remove the config all together gh dash loads up. (I was overlooking that the config was still there after re-installing.)

However, I'm simply clicking the "copy" button on the example config from the README and running pbpaste > ~/.config/gh-dash/config.yml. With that config in place, the above error occurs.

I wouldn't have expected these steps to be a cause for 🚨

Maybe not the most pressing issue.

dlvhdr commented 10 months ago

Hmm I don't think you can copy paste the config from the readme. You should let the program run without a config for the first time and it will write out a default one.