diff --git a/internal/radio/playlist.go b/internal/radio/playlist.go index fa25aba..52a0ebe 100644 --- a/internal/radio/playlist.go +++ b/internal/radio/playlist.go @@ -50,10 +50,16 @@ func (p *Playlist) load() error { if err != nil { 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.playlist = strings.Split(string(data), "\n") p.cur = 0 p.Unlock() + return nil }