Skip to content

Commit

Permalink
Do not load if there is no playlists
Browse files Browse the repository at this point in the history
  • Loading branch information
fabiofalci committed Jan 23, 2017
1 parent ada60da commit 16b630b
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions spotify/spotify_playlists.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package spotify

import (
"errors"
"strings"

"github.com/fabiofalci/sconsify/infrastructure"
Expand Down Expand Up @@ -78,6 +79,9 @@ func (spotify *Spotify) initWebApiPlaylist(playlists *sconsify.Playlists) error
} else {
fmt.Printf("Loaded %v from %v playlists\n", offset, total)
}
if total == 0 {
return errors.New("No playlist to load")
}
}
} else {
return err
Expand Down

0 comments on commit 16b630b

Please sign in to comment.