From 496575dea059ebd7e53074d759dbf58c34202894 Mon Sep 17 00:00:00 2001 From: Kana <7425261+Pitu@users.noreply.github.com> Date: Mon, 5 Mar 2018 01:40:45 -0300 Subject: [PATCH] Whoops --- controllers/uploadController.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/controllers/uploadController.js b/controllers/uploadController.js index 386ee02..4e4b2e0 100644 --- a/controllers/uploadController.js +++ b/controllers/uploadController.js @@ -39,7 +39,7 @@ uploadsController.upload = async (req, res, next) => { const token = req.headers.token || ''; const user = await db.table('users').where('token', token).first(); - if (user.enabled === false || user.enabled === 0) return res.json({ + if (user && (user.enabled === false || user.enabled === 0)) return res.json({ success: false, description: 'This account has been disabled' });