Skip to content

crashes when trying to find tracks with no internet connection #33

@ricoshett

Description

@ricoshett

Whenever I try to find tracks (pressing f or whatever the default key is) with no internet connection I end up getting the following error message:

Caught panic:

runtime error: invalid memory address or nil pointer dereference

Restoring terminal...

goroutine 1 [running]:
runtime/debug.Stack()
runtime/debug/stack.go:26 +0x5e
runtime/debug.PrintStack()
runtime/debug/stack.go:18 +0x13
github.com/charmbracelet/bubbletea.(*Program).recoverFromPanic(0xc00008e8c0)
github.com/charmbracelet/bubbletea@v1.3.4/tea.go:758 +0x8b
panic({0x66dca0?, 0xaa9930?})
runtime/panic.go:791 +0x132
github.com/dece2183/yamusic-tui/api.(*YaMusicClient).SearchSuggest(...)
github.com/dece2183/yamusic-tui/api/api.go:510
github.com/dece2183/yamusic-tui/ui/model/mainPage.(*Model).searchControl(0xc000180608, 0x0?)
github.com/dece2183/yamusic-tui/ui/model/mainPage/searchControl.go:39 +0x39b
github.com/dece2183/yamusic-tui/ui/model/mainPage.(*Model).Update(0xc000180608, {0x654500, 0x7cba08})
github.com/dece2183/yamusic-tui/ui/model/mainPage/mainPage.go:266 +0xe74
github.com/charmbracelet/bubbletea.(*Program).eventLoop(0xc00008e8c0, {0x7d42c0?, 0xc000180608?}, 0xc0001300e0)
github.com/charmbracelet/bubbletea@v1.3.4/tea.go:508 +0x850
github.com/charmbracelet/bubbletea.(*Program).Run(0xc00008e8c0)
github.com/charmbracelet/bubbletea@v1.3.4/tea.go:647 +0xaed
github.com/dece2183/yamusic-tui/ui/model/mainPage.(*Model).Run(0xc000180608)
github.com/dece2183/yamusic-tui/ui/model/mainPage/mainPage.go:88 +0x72
github.com/dece2183/yamusic-tui/ui.Run()
github.com/dece2183/yamusic-tui/ui/ui.go:22 +0x74
main.main()
github.com/dece2183/yamusic-tui/main.go:10 +0x18

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions