From 01b4209ba12275c27f8e55fa530f1ceec312771d Mon Sep 17 00:00:00 2001 From: Jonathan Cremin Date: Fri, 5 Dec 2014 19:46:01 +0000 Subject: [PATCH] Shore up itunes --- lib/services/itunes.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/services/itunes.js b/lib/services/itunes.js index a027df9..407f94c 100644 --- a/lib/services/itunes.js +++ b/lib/services/itunes.js @@ -19,7 +19,7 @@ module.exports.lookupId = function(id, type) { request.get(apiRoot + path, function(res) { var data = JSON.parse(res.text); - if (!data.results || !data.results[0].collectionId) { + if (!data.results || !data.results[0] || !data.results[0].collectionId) { var error = new Error("Not Found"); error.status = 404; deferred.reject(error);