Skip to content

Commit

Permalink
fix(grid-store): add missing callback
Browse files Browse the repository at this point in the history
  • Loading branch information
Jessica Lord authored and mbroadst committed Oct 18, 2017
1 parent a86359e commit 66a9a05
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lib/gridfs/grid_store.js
Original file line number Diff line number Diff line change
Expand Up @@ -452,7 +452,9 @@ var writeFile = function(self, file, callback) {
self.currentChunk = chunk;

if (offset >= stats.size) {
fs.close(file);
fs.close(file, function(err) {
if (err) return callback(err);
});
self.close(function(err) {
if (err) return callback(err, self);
return callback(null, self);
Expand Down

0 comments on commit 66a9a05

Please sign in to comment.