From 2be516236b30ab11f9c3282a3c34565b5b64da65 Mon Sep 17 00:00:00 2001 From: "Alexander \"Arav\" Andreev" Date: Sun, 1 Oct 2023 22:02:54 +0400 Subject: [PATCH] SongList.Current() will return nil if current song wasn't set yet. --- internal/radio/song.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/internal/radio/song.go b/internal/radio/song.go index bbfd05d..e2677ac 100644 --- a/internal/radio/song.go +++ b/internal/radio/song.go @@ -66,6 +66,9 @@ func (sl *SongList) Add(newSong Song_) { func (sl *SongList) Current() *Song_ { sl.mut.Lock() defer sl.mut.Unlock() + if sl.current.StartAt.Year() == 1 { + return nil + } return &sl.current }