diff --git a/routes/index.js b/routes/index.js index 6b5455f03e4..8392fe75181 100644 --- a/routes/index.js +++ b/routes/index.js @@ -217,6 +217,8 @@ exports.edit = function (req, res, next) { exports.update = function (req, res, next) { Todo.findById(req.params.id, function (err, todo) { + if (err) return next(err); + if (!todo) return res.status(404).send('Todo not found'); todo.content = req.body.content; todo.updated_at = Date.now(); diff --git a/sarif.json b/sarif.json index 60dd725676e..f4fd459ecf9 100644 --- a/sarif.json +++ b/sarif.json @@ -1881,7 +1881,7 @@ }, "region": { "startLine": 166, - "endLine": 221, + "endLine": 223, "startColumn": 18, "endColumn": 1 } @@ -1907,7 +1907,7 @@ }, "region": { "startLine": 166, - "endLine": 221, + "endLine": 223, "startColumn": 18, "endColumn": 1 } @@ -1978,8 +1978,8 @@ "uriBaseId": "%SRCROOT%" }, "region": { - "startLine": 223, - "endLine": 231, + "startLine": 225, + "endLine": 233, "startColumn": 21, "endColumn": 1 } @@ -2004,8 +2004,8 @@ "uriBaseId": "%SRCROOT%" }, "region": { - "startLine": 223, - "endLine": 231, + "startLine": 225, + "endLine": 233, "startColumn": 21, "endColumn": 1 } @@ -2021,8 +2021,8 @@ "uriBaseId": "%SRCROOT%" }, "region": { - "startLine": 225, - "endLine": 225, + "startLine": 227, + "endLine": 227, "startColumn": 21, "endColumn": 36 }