diff --git a/endpoints/cinema/index.js b/endpoints/cinema/index.js index d980acb8..ffdc7f77 100644 --- a/endpoints/cinema/index.js +++ b/endpoints/cinema/index.js @@ -57,7 +57,13 @@ app.get('/cinema', function (req, res, next) { }); // Clean up image URL - var imgURL = movie.find('img.poster').attr('src').match(/\/images\/poster\/.+\.(jpg|jpeg|png)/ig)[0]; + var imgURL; + + try{ + imgURL = movie.find('img.poster').attr('src').match(/\/images\/poster\/.+\.(jpg|jpeg|png)/ig)[0]; + }catch(e){ + console.log('Could not grab the image poster',e); + } // Create an object of info // and add it to the 'results' array. diff --git a/package.json b/package.json index b385d464..83e17219 100644 --- a/package.json +++ b/package.json @@ -30,7 +30,7 @@ "moment": "~2.1.0", "xml2js": "~0.2.8", "express": "~3.3.8", - "cheerio": "~0.12.2", + "cheerio": "~0.12.3", "request": "~2.27.0", "mocha": "~1.12.1", "scraper": "0.0.9",