From 16b630b18117d9b85bcb44c9553b6cf28f33600e Mon Sep 17 00:00:00 2001 From: Fabio Falci Date: Mon, 23 Jan 2017 18:15:12 +0000 Subject: [PATCH] Do not load if there is no playlists --- spotify/spotify_playlists.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/spotify/spotify_playlists.go b/spotify/spotify_playlists.go index aa35796..5536fd1 100644 --- a/spotify/spotify_playlists.go +++ b/spotify/spotify_playlists.go @@ -1,6 +1,7 @@ package spotify import ( + "errors" "strings" "github.com/fabiofalci/sconsify/infrastructure" @@ -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