DECE2183 / yamusic-tui

An unofficial Yandex Music terminal client.
GNU General Public License v3.0
45 stars 3 forks source link

crashes after selecting any menu item #11

Closed tehb13 closed 1 month ago

tehb13 commented 1 month ago
bin ./yamusic-tui
Caught panic:

runtime error: index out of range [0] with length 0

Restoring terminal...

goroutine 1 [running]:
runtime/debug.Stack()
    /usr/lib/go/src/runtime/debug/stack.go:26 +0x5e
runtime/debug.PrintStack()
    /usr/lib/go/src/runtime/debug/stack.go:18 +0x13
github.com/charmbracelet/bubbletea.(*Program).Run.func1()
    /home/t/go/pkg/mod/github.com/charmbracelet/bubbletea@v0.25.0/tea.go:478 +0x8b
panic({0x7dca20?, 0xc000223d58?})
    /usr/lib/go/src/runtime/panic.go:785 +0x132
github.com/dece2183/yamusic-tui/ui/model/mainPage.(*Model).playSelectedPlaylist(0xc0000965a0, 0x0)
    /home/t/go/pkg/mod/github.com/dece2183/yamusic-tui@v0.4.1/ui/model/mainPage/mainPage.go:487 +0x8d7
github.com/dece2183/yamusic-tui/ui/model/mainPage.(*Model).Update(0xc0000965a0, {0x786de0, 0x8adf88})
    /home/t/go/pkg/mod/github.com/dece2183/yamusic-tui@v0.4.1/ui/model/mainPage/mainPage.go:150 +0x691
github.com/charmbracelet/bubbletea.(*Program).eventLoop(0xc0001b61a0, {0x8b3078?, 0xc0000965a0?}, 0xc000028f50)
    /home/t/go/pkg/mod/github.com/charmbracelet/bubbletea@v0.25.0/tea.go:411 +0x5e2
github.com/charmbracelet/bubbletea.(*Program).Run(0xc0001b61a0)
    /home/t/go/pkg/mod/github.com/charmbracelet/bubbletea@v0.25.0/tea.go:543 +0x84b
github.com/dece2183/yamusic-tui/ui/model/mainPage.(*Model).Run(0xc0000965a0)
    /home/t/go/pkg/mod/github.com/dece2183/yamusic-tui@v0.4.1/ui/model/mainPage/mainPage.go:69 +0x3f
github.com/dece2183/yamusic-tui/ui.Run()
    /home/t/go/pkg/mod/github.com/dece2183/yamusic-tui@v0.4.1/ui/ui.go:21 +0x3e
main.main()
    /home/t/go/pkg/mod/github.com/dece2183/yamusic-tui@v0.4.1/main.go:8 +0xf
DECE2183 commented 1 month ago

If your track list is empty, it's because Yandex requires you to pass a captcha. I'm thinking about how to solve this problem.

DECE2183 commented 1 month ago

Fixed in b96ad23 commit (thanks @bulatorr for the solution)