From c9e05cf9f6c7403e046c82a6751468ff8f4638c8 Mon Sep 17 00:00:00 2001 From: Dave Conway-Jones Date: Fri, 23 Jun 2017 21:48:13 +0100 Subject: [PATCH] split node - in object mode allow msg.complete on its own --- nodes/core/logic/17-split.js | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/nodes/core/logic/17-split.js b/nodes/core/logic/17-split.js index 91a24dfa5..31809941c 100644 --- a/nodes/core/logic/17-split.js +++ b/nodes/core/logic/17-split.js @@ -309,6 +309,7 @@ module.exports = function(RED) { node.warn("Message missing msg.parts property - cannot join in 'auto' mode") return; } + if (node.propertyType == "full") { property = msg; } @@ -351,11 +352,18 @@ module.exports = function(RED) { propertyKey = RED.util.getMessageProperty(msg,node.key); } } + if ((payloadType === 'object') && (propertyKey === null || propertyKey === undefined || propertyKey === "")) { if (node.mode === "auto") { node.warn("Message missing 'msg.parts.key' property - cannot add to object"); - } else { - node.warn("Message missing key property 'msg."+node.key+"' - cannot add to object") + } + else { + if (msg.hasOwnProperty('complete')) { + completeSend(partId); + } + else { + node.warn("Message missing key property 'msg."+node.key+"' - cannot add to object") + } } return; }