Explorar o código

Checked if songs exist in playlist before returning them

theflametrooper %!s(int64=8) %!d(string=hai) anos
pai
achega
467e356c11
Modificáronse 1 ficheiros con 1 adicións e 1 borrados
  1. 1 1
      backend/logic/actions/playlists.js

+ 1 - 1
backend/logic/actions/playlists.js

@@ -120,7 +120,7 @@ let lib = {
 		],
 		(err, playlist) => {
 			if (err) return cb({ status: 'error', message: err });
-			else return cb({ status: 'success', message: 'Playlist has been successfully added', data: playlist.songs });
+			else if (playlist.songs) return cb({ status: 'success', message: 'Playlist has been successfully added', data: playlist.songs });
 		});
 	},