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-02-03 02:02:23 +0300
committerFeross Aboukhadijeh <feross@feross.org>2015-02-03 02:02:23 +0300
commit610f866bdc7a61847351fbf5fc67417c9ba3b1b7 (patch)
tree6045df123297ba9deff86fcd9f2e21f361bb5e56 /lib/storage.js
parentfd13be21374455fd8676d9ed0c4f8d85282a9659 (diff)
fix file.createReadStream regression
`opts` param is optional
Diffstat (limited to 'lib/storage.js')
-rw-r--r--lib/storage.js1
1 files changed, 1 insertions, 0 deletions
diff --git a/lib/storage.js b/lib/storage.js
index 911e978..539d83b 100644
--- a/lib/storage.js
+++ b/lib/storage.js
@@ -259,6 +259,7 @@ File.prototype.deselect = function () {
*/
File.prototype.createReadStream = function (opts) {
var self = this
+ if (!opts) opts = {}
if (opts.pieceLength == null) opts.pieceLength = self.pieceLength
var stream = new FileStream(self, opts)
self.storage.emit('select', stream.startPiece, stream.endPiece, true, stream.notify.bind(stream))