diff --git a/searchitunes.js b/searchitunes.js index a354c44..79bd05b 100644 --- a/searchitunes.js +++ b/searchitunes.js @@ -83,10 +83,12 @@ module.exports = async function SearchItunes ( { const res = await fetch( url, options ); const data = await res.json(); + // Empty result if ( ! data.results || ! data.results.length ) { throw new Error( 'no results' ); } + // Lookup response if ( idKey ) { // Bulk lookup