diff options
author | Feross Aboukhadijeh <feross@feross.org> | 2016-04-06 07:29:58 +0300 |
---|---|---|
committer | Feross Aboukhadijeh <feross@feross.org> | 2016-04-06 07:29:58 +0300 |
commit | 446e67271e7b6e5ffc35a4bd255724a62eeb62fa (patch) | |
tree | 22d0a58b71606e2bf10053a7654b39a69b309bb1 | |
parent | f2ea073b5691a6a213868142cf4481fe1b9ea850 (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.js | 3 |
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) { |