diff --git a/index.js b/index.js index d20e199..9f9e113 100644 --- a/index.js +++ b/index.js @@ -103,7 +103,7 @@ function diff(current, checked) { app.post("/updates/:project(\\w+)", (req, res) => { let project_id = req.params['project']; - const body = String(req.body) || ""; + const body = (typeof req.body == "string") ? req.body : ""; let adjustedBody = body.replace(/\r/, ""); let indexes = get_indexes(project_id); let difference = diff(indexes, adjustedBody);