Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/webtorrent/webtorrent.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFeross Aboukhadijeh <feross@feross.org>2016-04-06 07:29:58 +0300
committerFeross Aboukhadijeh <feross@feross.org>2016-04-06 07:29:58 +0300
commit446e67271e7b6e5ffc35a4bd255724a62eeb62fa (patch)
tree22d0a58b71606e2bf10053a7654b39a69b309bb1
parentf2ea073b5691a6a213868142cf4481fe1b9ea850 (diff)
Fix ENOENT error when one file is missing from filesystem
Fixes https://github.com/feross/webtorrent-desktop/issues/311
-rw-r--r--lib/torrent.js3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/torrent.js b/lib/torrent.js
index 0e83e56..01f08e0 100644
--- a/lib/torrent.js
+++ b/lib/torrent.js
@@ -449,8 +449,9 @@ Torrent.prototype.getFileModtimes = function (cb) {
parallelLimit(self.files.map(function (file, index) {
return function (cb) {
fs.stat(path.join(self.path, file.path), function (err, stat) {
+ if (err && err.code !== 'ENOENT') return cb(err)
ret[index] = stat && stat.mtime.getTime()
- cb(err)
+ cb(null)
})
}
}), FILESYSTEM_CONCURRENCY, function (err) {