SongList.Current() will return nil if current song wasn't set yet.
This commit is contained in:
parent
dea283df27
commit
2be516236b
@ -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
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user