From 7cd8b2b788f12fa0ee6cecae9568ed779b47123e Mon Sep 17 00:00:00 2001 From: Mathias Date: Sat, 6 Aug 2022 23:50:59 +0200 Subject: [PATCH] Fixed a bug in the config route --- server/routes/config.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server/routes/config.js b/server/routes/config.js index 8a1ca739..3ebe615f 100644 --- a/server/routes/config.js +++ b/server/routes/config.js @@ -26,7 +26,7 @@ app.patch("/:key", async (req, res) => { if ((req.params.key === "ping" || req.params.key === "download" || req.params.key === "upload" || req.params.key === "timeLevel") && isNaN(req.body.value)) return res.status(400).json({message: "You need to provide a number in order to change this"}); - if (req.params.key === "ping") + if (req.params.key === "ping" && req.body.value instanceof String) req.body.value = req.body.value.split(".")[0]; if (req.params.key === "password" && req.body.value !== "none") req.body.value = await require('bcrypt').hash(req.body.value, 10);