From 7de25210ce629fff1f731dd8a485ba0a3b8c30b6 Mon Sep 17 00:00:00 2001 From: Bobby Wibowo Date: Wed, 24 Jan 2018 19:38:32 +0700 Subject: [PATCH] Proper undefined check --- controllers/uploadController.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/controllers/uploadController.js b/controllers/uploadController.js index 9f10c8c..84fb40c 100644 --- a/controllers/uploadController.js +++ b/controllers/uploadController.js @@ -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 {