diff options
| author | Adam Soltys <[email protected]> | 2015-11-24 10:07:57 -0800 |
|---|---|---|
| committer | Adam Soltys <[email protected]> | 2015-11-27 22:02:48 -0800 |
| commit | 9d4926c942928333ce9436649fe47abd3399003a (patch) | |
| tree | 947c1469316c53627b681ebcee62b44c0bbb5568 /routes | |
| parent | 7db9ced7b02fac057c97460069ba800b6db2e391 (diff) | |
| download | coinos-server-9d4926c942928333ce9436649fe47abd3399003a.tar.gz coinos-server-9d4926c942928333ce9436649fe47abd3399003a.zip | |
Error handling
Diffstat (limited to 'routes')
| -rw-r--r-- | routes/users.js | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/routes/users.js b/routes/users.js index 4ef67d2c..70d9231c 100644 --- a/routes/users.js +++ b/routes/users.js @@ -59,7 +59,9 @@ path = "public/assets/img/logos/" + obj.username + "." + ext; fs.lstat(path, function(err, stats) { if ((ext === 'jpg' || ext === 'png' || ext === 'gif') && (err || !stats.isFile())) { - return request("" + obj.logo).pipe(fs.createWriteStream(path)); + try { + return request("" + obj.logo).pipe(fs.createWriteStream(path)); + } catch (_error) {} } }); } |
