From 5ac1b59a78b0e3f3d6c21704ed9ef241c8d0cca5 Mon Sep 17 00:00:00 2001 From: Henry Oswald Date: Tue, 8 Apr 2014 21:06:01 +0100 Subject: [PATCH] added err check to project list page --- .../app/coffee/Features/Project/ProjectController.coffee | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/services/web/app/coffee/Features/Project/ProjectController.coffee b/services/web/app/coffee/Features/Project/ProjectController.coffee index d9525abc79..0aa58f5e19 100644 --- a/services/web/app/coffee/Features/Project/ProjectController.coffee +++ b/services/web/app/coffee/Features/Project/ProjectController.coffee @@ -69,8 +69,11 @@ module.exports = projects: (cb)-> Project.findAllUsersProjects user_id, 'name lastUpdated publicAccesLevel', cb }, (err, results)-> + if err? + logger.err err:err, "error getting data for project list page" + return res.send 500 logger.log results:results, user_id:user_id, "rendering project list" - viewModel = _buildListViewModel results.projects[0], results.projects[1], results.projects[2], results.tags[0], results.tags[1], results.subscription[0] + viewModel = _buildListViewModel results.projects[0], results.projects[1], results.projects[2], results.tags[0], results.tags[1], results.subscription?[0] res.render 'project/list', viewModel timer.done() @@ -96,7 +99,7 @@ module.exports = project = results.project user = results.user subscription = results.subscription - + if user_id == 'openUser' anonymous = true user = defaultSettingsForAnonymousUser(user_id)