From a5d021972ba4e562e51fec24eafb84720a3c1544 Mon Sep 17 00:00:00 2001 From: hippoz Date: Sun, 3 Jan 2021 17:14:25 +0200 Subject: [PATCH] fix error when special code is missing --- api/v1/users.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/api/v1/users.js b/api/v1/users.js index d631244..3a9fa5c 100755 --- a/api/v1/users.js +++ b/api/v1/users.js @@ -23,10 +23,12 @@ const createAccountLimiter = rateLimit({ }); app.get('/account/create/info', async (req, res) => { - const restrictions = config.restrictions.signup; let requiresCode = false; - if (restrictions && restrictions.specialCode) { - requiresCode = true; + if (config.restrictions) { + const restrictions = config.restrictions.signup; + if (restrictions && restrictions.specialCode) { + requiresCode = true; + } } res.json({