achannarasappa / ticker

Terminal stock ticker with live updates and position tracking
GNU General Public License v3.0
5.02k stars 273 forks source link

Panic in 3.1.4 #119

Closed viperperidot closed 3 years ago

viperperidot commented 3 years ago

Had this happen while running the latest version:

Caught panic:

interface conversion: interface {} is nil, not map[string]position.Position

Restoring terminal...

goroutine 1 [running]:
runtime/debug.Stack(0x73, 0x0, 0x0)
    /opt/hostedtoolcache/go/1.15.8/x64/src/runtime/debug/stack.go:24 +0x9f
runtime/debug.PrintStack()
    /opt/hostedtoolcache/go/1.15.8/x64/src/runtime/debug/stack.go:16 +0x25
github.com/charmbracelet/bubbletea.(*Program).Start.func1(0xc000424b10)
    /home/runner/go/pkg/mod/github.com/charmbracelet/bubbletea@v0.12.2/tea.go:119 +0xd3
panic(0x9179a0, 0xc000650090)
    /opt/hostedtoolcache/go/1.15.8/x64/src/runtime/panic.go:969 +0x1b9
github.com/achannarasappa/ticker/internal/position.GetPositions.func1(0xd32c88, 0x0, 0x0, 0xc0001823a8, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0)
    /home/runner/work/ticker/ticker/internal/position/position.go:162 +0x5c7

~$ ticker/internal/ui.Model.Update(0x5, 0xc00006a8c0, 0x5, 0x5, 0xc000194000, 0x6, 0x6, 0x101010101, 0x0, 0x0, ...)
    /home/runner/work/ticker/ticker/internal/ui/ui.go:118 +0x4fa
github.com/charmbracelet/bubbletea.(*Program).Start(0xc000424b10, 0x0, 0x0)
    /home/runner/go/pkg/mod/github.com/charmbracelet/bubbletea@v0.12.2/tea.go:214 +0x61c
github.com/achannarasappa/ticker/internal/ui.Start.func1(0x0, 0x0)
    /home/runner/work/ticker/ticker/internal/ui/start.go:14 +0x1b6
github.com/achannarasappa/ticker/internal/cli.Run.func1(0xcf7ac0, 0xd32c88, 0x0, 0x0)
    /home/runner/work/ticker/ticker/internal/cli/cli.go:35 +0x2a
github.com/spf13/cobra.(*Command).execute(0xcf7ac0, 0xc00001e1d0, 0x0, 0x0, 0xcf7ac0, 0xc00001e1d0)
    /home/runner/go/pkg/mod/github.com/spf13/cobra@v1.1.1/command.go:854 +0x2c2
github.com/spf13/cobra.(*Command).ExecuteC(0xcf7ac0, 0x44570a, 0xcaf140, 0xc000042778)
    /home/runner/go/pkg/mod/github.com/spf13/cobra@v1.1.1/command.go:958 +0x375
github.com/spf13/cobra.(*Command).Execute(...)
    /home/runner/go/pkg/mod/github.com/spf13/cobra@v1.1.1/command.go:895
github.com/achannarasappa/ticker/cmd.Execute()
    /home/runner/work/ticker/ticker/cmd/root.go:33 +0x31
main.main()
    /home/runner/work/ticker/ticker/main.go:6 +0x25
achannarasappa commented 3 years ago

Thanks for reporting - not sure what's going on here. It could possibly have been caused by a network interruption. I've removed the gubrak so hopefully if this happens again, a more descriptive error will be produced.

viperperidot commented 3 years ago

Awesome I will re-open this if it happens again thanks!