fix crash
continuous-integration/drone/tag Build is passing Details

This commit is contained in:
abs3nt 2023-01-16 21:12:46 -08:00
parent a758f7a199
commit eaf173573c
1 changed files with 2 additions and 2 deletions

View File

@ -391,7 +391,7 @@ func (m *mainModel) Tick() {
select {
case <-ticker.C:
playing, _ := m.client.PlayerCurrentlyPlaying(m.ctx)
if playing != nil && playing.Playing {
if playing != nil && playing.Playing && playing.Item != nil {
currentlyPlaying = "Now playing " + playing.Item.Name + " by " + playing.Item.Artists[0].Name
}
case <-quit:
@ -543,7 +543,7 @@ func InitMain(ctx *gctx.Context, client *spotify.Client, mode Mode) (tea.Model,
if err != nil {
return nil, err
}
if playing != nil && playing.Playing {
if playing != nil && playing.Playing && playing.Item != nil {
currentlyPlaying = "Now playing " + playing.Item.Name + " by " + playing.Item.Artists[0].Name
}
items := []list.Item{}