Only then call make on cache if it is nil.
This commit is contained in:
parent
e402829724
commit
7df94bef12
@ -183,7 +183,9 @@ func (pw *PlaylistLogWatcher) Watch(playlistPath string, n int) (err error) {
|
|||||||
|
|
||||||
pw.watcher.WatchForMask(pw.changed, watcher.ModIgnMask)
|
pw.watcher.WatchForMask(pw.changed, watcher.ModIgnMask)
|
||||||
|
|
||||||
|
if lastPlayedCache == nil {
|
||||||
lastPlayedCache = make([]Song, 0, n)
|
lastPlayedCache = make([]Song, 0, n)
|
||||||
|
}
|
||||||
|
|
||||||
go func() {
|
go func() {
|
||||||
for {
|
for {
|
||||||
|
Loading…
Reference in New Issue
Block a user