diff options
| author | Bobby Wibowo <[email protected]> | 2018-01-24 19:53:31 +0700 |
|---|---|---|
| committer | Bobby Wibowo <[email protected]> | 2018-01-24 19:53:31 +0700 |
| commit | 5052cd26511f2e8f39844b180bf0e1df4141e473 (patch) | |
| tree | 6f0e6d226ab0061b505e8c6de1128bbd64174c56 /controllers/uploadController.js | |
| parent | Proper undefined check (diff) | |
| download | host.fuwn.me-5052cd26511f2e8f39844b180bf0e1df4141e473.tar.xz host.fuwn.me-5052cd26511f2e8f39844b180bf0e1df4141e473.zip | |
Sorry.
At first I was concerned due to a particular ESLint rule called "no-undefined", but then after looking more deeply into it, I realized using typeof was unnecessary since "no-global-assign" and "no-shadow-restricted-names" were enabled and thus the previous method surely would not cause any problems.
Diffstat (limited to 'controllers/uploadController.js')
| -rw-r--r-- | controllers/uploadController.js | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/controllers/uploadController.js b/controllers/uploadController.js index 84fb40c..9f10c8c 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: typeof userid !== 'undefined' ? userid.id : null, + userid: userid !== undefined ? userid.id : null, timestamp: Math.floor(Date.now() / 1000) }); } else { |