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>2015-07-08 00:53:09 +0300
committerFeross Aboukhadijeh <feross@feross.org>2015-07-08 00:53:09 +0300
commiteed6f37482f110613e12da5f92efd1cc62430756 (patch)
treec5b1bb92b8f2eb85eb2c9cc5463e1768064d1624
parentdd911816ada62f98301a4285a9b4df389659d508 (diff)
fs-storage: return after open if storage is closed
-rw-r--r--lib/fs-storage.js1
1 files changed, 1 insertions, 0 deletions
diff --git a/lib/fs-storage.js b/lib/fs-storage.js
index bc58e2d..553e3d0 100644
--- a/lib/fs-storage.js
+++ b/lib/fs-storage.js
@@ -128,6 +128,7 @@ FSStorage.prototype.readBlock = function (index, offset, length, cb) {
}
target.openRead(function (err, file) {
+ if (self.closed) return
if (err) {
return err === self.nonExistentError
? readFromNextFile(null, new Buffer(0))