Proper undefined check

This commit is contained in:
Bobby Wibowo 2018-01-24 19:39:22 +07:00
parent d5fcb2ee26
commit 8598001ee3
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 {