From d09705142e9b86cfd6654aa50744a81492687af4 Mon Sep 17 00:00:00 2001 From: James Allen Date: Tue, 15 Mar 2016 14:07:34 +0000 Subject: [PATCH] Add in missing error checks --- .../coffee/Features/Collaborators/CollaboratorsHandler.coffee | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/services/web/app/coffee/Features/Collaborators/CollaboratorsHandler.coffee b/services/web/app/coffee/Features/Collaborators/CollaboratorsHandler.coffee index 3f76a6bedb..7f0cd6ebca 100644 --- a/services/web/app/coffee/Features/Collaborators/CollaboratorsHandler.coffee +++ b/services/web/app/coffee/Features/Collaborators/CollaboratorsHandler.coffee @@ -65,8 +65,10 @@ module.exports = CollaboratorsHandler = getProjectsUserIsCollaboratorOf: (user_id, fields, callback = (error, readAndWriteProjects, readOnlyProjects) ->) -> Project.find {collaberator_refs:user_id}, fields, (err, readAndWriteProjects)=> + return callback(err) if err? Project.find {readOnly_refs:user_id}, fields, (err, readOnlyProjects)=> - callback(err, readAndWriteProjects, readOnlyProjects) + return callback(err) if err? + callback(null, readAndWriteProjects, readOnlyProjects) removeUserFromProject: (project_id, user_id, callback = (error) ->)-> logger.log user_id: user_id, project_id: project_id, "removing user"