From a235745be7ffaef2cad84c6a711ca70b7911595f Mon Sep 17 00:00:00 2001 From: Dave Conway-Jones Date: Wed, 2 Nov 2016 15:49:51 +0000 Subject: [PATCH] Fix missing 0 handling for css node with array input --- nodes/core/parsers/70-CSV.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nodes/core/parsers/70-CSV.js b/nodes/core/parsers/70-CSV.js index 4acc4158e..f81a96b11 100644 --- a/nodes/core/parsers/70-CSV.js +++ b/nodes/core/parsers/70-CSV.js @@ -58,7 +58,7 @@ module.exports = function(RED) { if ((Array.isArray(msg.payload[s])) || (typeof msg.payload[s] !== "object")) { if (typeof msg.payload[s] !== "object") { msg.payload = [ msg.payload ]; } for (var t = 0; t < msg.payload[s].length; t++) { - if (!msg.payload[s][t]) { msg.payload[s][t] = ""; } + if (!msg.payload[s][t] && (msg.payload[s][t] !== 0)) { msg.payload[s][t] = ""; } if (msg.payload[s][t].toString().indexOf(node.quo) !== -1) { // add double quotes if any quotes msg.payload[s][t] = msg.payload[s][t].toString().replace(/"/g, '""'); msg.payload[s][t] = node.quo + msg.payload[s][t].toString() + node.quo;