tasks.get returns null on not found
This commit is contained in:
@@ -30,6 +30,7 @@ async function get(req, res, next) {
|
||||
|
||||
const [error, task] = await safe(tasks.get(req.params.taskId));
|
||||
if (error) return next(BoxError.toHttpError(error));
|
||||
if (!task) return next(new HttpError(404, 'task not found'));
|
||||
|
||||
next(new HttpSuccess(200, tasks.removePrivateFields(task)));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user