From 3b33f3accacec80465f73c59c1fc123eae66dcd3 Mon Sep 17 00:00:00 2001 From: Cassie Tarakajian Date: Mon, 27 Nov 2017 15:14:50 -0500 Subject: [PATCH] catch getProjectAsset error --- server/controllers/project.controller.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/server/controllers/project.controller.js b/server/controllers/project.controller.js index 978207a0..a171ce9f 100644 --- a/server/controllers/project.controller.js +++ b/server/controllers/project.controller.js @@ -143,6 +143,10 @@ export function getProjectAsset(req, res) { if (err) { return res.status(404).send({ message: 'Project with that id does not exist' }); } + if (!project) { + console.error(req.params.project_id); + return res.status(404).send({ message: 'Project with that id does not exist' }); + } let assetURL = null; const seekPath = req.params[0]; // req.params.asset_path;