Proper undefined check

This commit is contained in:
Bobby Wibowo 2018-01-24 19:38:32 +07:00
parent 38d77fdfbb
commit 7de25210ce
No known key found for this signature in database
GPG Key ID: 51C3A1E1E22D26CF

View File

@ -98,7 +98,7 @@ uploadsController.actuallyUpload = async (req, res, userid, album) => {
hash: fileHash,
ip: req.ip,
albumid: album,
userid: userid !== undefined ? userid.id : null,
userid: typeof userid !== 'undefined' ? userid.id : null,
timestamp: Math.floor(Date.now() / 1000)
});
} else {