From 03e4c65cd8efdb5f2e954ccb58fd7d96b460896d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pawe=C5=82=20Malak?= Date: Mon, 15 Nov 2021 16:33:06 +0100 Subject: [PATCH] Fixed #177 --- controllers/apps/createApp.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/controllers/apps/createApp.js b/controllers/apps/createApp.js index 5f4adba..a8208fa 100644 --- a/controllers/apps/createApp.js +++ b/controllers/apps/createApp.js @@ -9,7 +9,11 @@ const createApp = asyncWrapper(async (req, res, next) => { const { pinAppsByDefault } = await loadConfig(); let app; - let _body = { ...req.body, icon: req.body.icon.trim() }; + let _body = { ...req.body }; + + if (_body.icon) { + _body.icon = _body.icon.trim(); + } if (req.file) { _body.icon = req.file.filename;