1
0

SongList.Current() will return nil if current song wasn't set yet.

This commit is contained in:
Alexander Andreev 2023-10-01 22:02:54 +04:00
parent dea283df27
commit 2be516236b
Signed by: Arav
GPG Key ID: D22A817D95815393

View File

@ -66,6 +66,9 @@ func (sl *SongList) Add(newSong Song_) {
func (sl *SongList) Current() *Song_ { func (sl *SongList) Current() *Song_ {
sl.mut.Lock() sl.mut.Lock()
defer sl.mut.Unlock() defer sl.mut.Unlock()
if sl.current.StartAt.Year() == 1 {
return nil
}
return &sl.current return &sl.current
} }