1
0
mirror of https://github.com/node-red/node-red.git synced 2023-10-10 13:36:53 +02:00

clone msg more correctly for CSV node multiple line output

This commit is contained in:
dceejay 2015-02-22 21:56:52 +00:00
parent 339e6039e1
commit 51421ce657

View File

@ -124,8 +124,9 @@ module.exports = function(RED) {
} }
if (JSON.stringify(o) !== "{}") { // don't send empty objects if (JSON.stringify(o) !== "{}") { // don't send empty objects
if (node.multi === "one") { if (node.multi === "one") {
msg.payload = o; var newMessage = RED.util.cloneMessage(msg);
node.send(msg); // either send newMessage.payload = o;
node.send(newMessage); // either send
} }
else { a.push(o); } // or add to the array else { a.push(o); } // or add to the array
} }
@ -148,8 +149,9 @@ module.exports = function(RED) {
} }
if (JSON.stringify(o) !== "{}") { // don't send empty objects if (JSON.stringify(o) !== "{}") { // don't send empty objects
if (node.multi === "one") { if (node.multi === "one") {
msg.payload = o; var newMessage = RED.util.cloneMessage(msg);
node.send(msg); // either send newMessage.payload = o;
node.send(newMessage); // either send
} }
else { a.push(o); } // or add to the aray else { a.push(o); } // or add to the aray
} }