Skip to content

Commit

Permalink
tidied up implementation of file node close fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Dave Conway-Jones committed Jun 28, 2017
1 parent 160c27c commit dded98e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions nodes/core/storage/50-file.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ module.exports = function(RED) {
node.wstream.on("error", function(err) {
node.error(RED._("file.errors.writefail",{error:err.toString()}),msg);
});
node.wstream.write(node.data.shift(), function() { node.wstream.end(); });
node.wstream.end(node.data.shift());
}
else {
if ((!node.wstream) || (!node.filename)) {
Expand All @@ -73,7 +73,7 @@ module.exports = function(RED) {
});
}
if (node.filename) { node.wstream.write(node.data.shift()); }
else { node.wstream.write(node.data.shift(), function() { node.wstream.end(); }); }
else { node.wstream.end(node.data.shift()); }
}
}
}
Expand Down

0 comments on commit dded98e

Please sign in to comment.