This commit is contained in:
Kana 2018-03-05 01:40:45 -03:00 committed by GitHub
parent 8a75ab91a6
commit 496575dea0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -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'
});