Fix join node manual mode array

msg.complete was adding an unwanted null to the array (if no payload)
Added tests for msg.complete with array and object
This commit is contained in:
Dave Conway-Jones
2018-06-14 20:00:42 +01:00
parent fef71f29c4
commit 6f5974f875
2 changed files with 62 additions and 8 deletions

View File

@@ -619,10 +619,13 @@ module.exports = function(RED) {
} else {
if (!isNaN(propertyIndex)) {
group.payload[propertyIndex] = property;
group.currentCount++;
} else {
group.payload.push(property);
if (property !== undefined) {
group.payload.push(property);
group.currentCount++;
}
}
group.currentCount++;
}
// TODO: currently reuse the last received - add option to pick first received
group.msg = msg;