Skip to content

Commit

Permalink
fix file.createReadStream regression
Browse files Browse the repository at this point in the history
`opts` param is optional
  • Loading branch information
feross committed Feb 2, 2015
1 parent fd13be2 commit 610f866
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions lib/storage.js
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down

0 comments on commit 610f866

Please sign in to comment.