From dded98e30c9dc80ec9dcf2061cf4c096c2ce9d29 Mon Sep 17 00:00:00 2001 From: Dave Conway-Jones Date: Wed, 28 Jun 2017 17:50:09 +0100 Subject: [PATCH] tidied up implementation of file node close fix --- nodes/core/storage/50-file.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/nodes/core/storage/50-file.js b/nodes/core/storage/50-file.js index c8788e45d..236a9b835 100644 --- a/nodes/core/storage/50-file.js +++ b/nodes/core/storage/50-file.js @@ -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)) { @@ -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()); } } } }