aheckmann / gridfs-stream

Easily stream files to and from MongoDB
MIT License
615 stars 120 forks source link

writeStream doesn't handle empty stream properly. #30

Closed shileiyu closed 10 years ago

shileiyu commented 10 years ago
var inStream = self.gfs.createWriteStream(options);
inStream.on('close', function(file) {
    console.log('never happened if content is an empty stream').
});
content.pipe(inStream);
Reggino commented 10 years ago

Your sample code doesn't show what content exactly is in this case, or what is done with it.

Please provide a unit test describing the exact issue.