Skip to content

Commit

Permalink
Don't call stream.setEncoding() if options.encoding is strictly null
Browse files Browse the repository at this point in the history
  • Loading branch information
Andre Azzolini committed Apr 28, 2016
1 parent 453b2f7 commit 9b6fc20
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lib/readfilesstream.js
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,9 @@ function readFilesStream(dir, options, callback, complete) {
if (options.shortName) files.push(filename);
else files.push(file);
var stream = fs.createReadStream(file);
stream.setEncoding(options.encoding);
if (options.encoding !== null) {
stream.setEncoding(options.encoding);
}
stream.on('error',function(err) {
if (options.doneOnErr === true) return done(err);
next();
Expand Down

0 comments on commit 9b6fc20

Please sign in to comment.