Fix join to not crash on appending invalid tyoes to buffer.

Add extra info to clarify use of complete
to Close #2505
This commit is contained in:
Dave Conway-Jones
2020-03-15 16:43:32 +00:00
parent 43258ee816
commit 85a1f59a93
3 changed files with 13 additions and 5 deletions

View File

@@ -630,7 +630,13 @@ module.exports = function(RED) {
var group = inflight[partId];
if (payloadType === 'buffer') {
if (property !== undefined) {
inflight[partId].bufferLen += property.length;
if (Buffer.isBuffer(property) || (typeof property === "string") || Array.isArray(property)) {
inflight[partId].bufferLen += property.length;
}
else {
node.error(RED._("join.errors.invalid-type",{error:(typeof property)}),msg);
return;
}
}
}
if (payloadType === 'object') {