In Playlist.load() a check for an empty file was added.
This commit is contained in:
parent
131ea35341
commit
da4e97f1aa
@ -50,10 +50,16 @@ func (p *Playlist) load() error {
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
return errors.Wrap(err, "cannot open a playlist file")
|
return errors.Wrap(err, "cannot open a playlist file")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if len(data) == 0 {
|
||||||
|
return errors.New("a playlist file is empty. Did not update")
|
||||||
|
}
|
||||||
|
|
||||||
p.Lock()
|
p.Lock()
|
||||||
p.playlist = strings.Split(string(data), "\n")
|
p.playlist = strings.Split(string(data), "\n")
|
||||||
p.cur = 0
|
p.cur = 0
|
||||||
p.Unlock()
|
p.Unlock()
|
||||||
|
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user