diff options
author | Feross Aboukhadijeh <feross@feross.org> | 2016-08-19 02:31:29 +0300 |
---|---|---|
committer | Feross Aboukhadijeh <feross@feross.org> | 2016-08-19 02:31:29 +0300 |
commit | 535fa0264a8e7106266770449de9266e0d598684 (patch) | |
tree | bce87c03156b133a1c2b29df0d0ba23163e808da /lib | |
parent | 6e43ae5e5e00ef699ba3b9428f54691270834393 (diff) |
Prevent possible stack overflow
See https://github.com/feross/run-parallel-limit/issues/5
Diffstat (limited to 'lib')
-rw-r--r-- | lib/torrent.js | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/torrent.js b/lib/torrent.js index f27296b..a695d07 100644 --- a/lib/torrent.js +++ b/lib/torrent.js @@ -581,7 +581,7 @@ Torrent.prototype._verifyPieces = function () { return function (cb) { if (self.destroyed) return cb(new Error('torrent is destroyed')) self.store.get(index, function (err, buf) { - if (err) return cb(null) // ignore error + if (err) return process.nextTick(cb, null) // ignore error sha1(buf, function (hash) { if (hash === self._hashes[index]) { if (!self.pieces[index]) return |