diff --git a/index.js b/index.js index d5ea115..90987b2 100644 --- a/index.js +++ b/index.js @@ -103,9 +103,10 @@ function diff(current, checked) { app.post("/updates/:project(\\w+)", (req, res) => { let project_id = req.params['project']; - const body = req.body.replace(/\r/, ""); + const body = req.body || ""; + let adjustedBody = body.replace(/\r/, ""); let indexes = get_indexes(project_id); - let difference = diff(indexes, body); + let difference = diff(indexes, adjustedBody); if (difference.length > 0) { res.send(difference);