mirror of
				https://github.com/node-red/node-red.git
				synced 2025-03-01 10:36:34 +00:00 
			
		
		
		
	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:
		| @@ -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') { | ||||
|   | ||||
| @@ -894,7 +894,8 @@ | ||||
|             "fixup": "Fix-up exp" | ||||
|         }, | ||||
|         "errors": { | ||||
|             "invalid-expr": "Invalid JSONata expression: __error__" | ||||
|             "invalid-expr": "Invalid JSONata expression: __error__", | ||||
|             "invalid-type": "Cannot join __error__ to buffer" | ||||
|         } | ||||
|     }, | ||||
|     "sort" : { | ||||
|   | ||||
| @@ -14,7 +14,7 @@ | ||||
|   limitations under the License. | ||||
| --> | ||||
|  | ||||
| <script type="text/x-red" data-help-name="split"> | ||||
| <script type="text/html" data-help-name="split"> | ||||
|     <p>Splits a message into a sequence of messages.</p> | ||||
|  | ||||
|     <h3>Inputs</h3> | ||||
| @@ -63,7 +63,7 @@ | ||||
|     means it cannot be used with the <b>join</b> node in its automatic mode</p> | ||||
| </script> | ||||
|  | ||||
| <script type="text/x-red" data-help-name="join"> | ||||
| <script type="text/html" data-help-name="join"> | ||||
|     <p>Joins sequences of messages into a single message.</p> | ||||
|     <p>There are three modes available:</p> | ||||
|     <dl> | ||||
| @@ -91,7 +91,8 @@ | ||||
|         </ul> | ||||
|         </dd> | ||||
|         <dt class="optional">complete</dt> | ||||
|         <dd>If set, the node will send its output message in its current state.</dd> | ||||
|         <dd>If set, the node will append the payload, and then send the output message in its current state.  | ||||
|             If you don't wish to append the payload, delete it from the msg.</dd> | ||||
|     </dl> | ||||
|     <h3>Details</h3> | ||||
|  | ||||
|   | ||||
		Reference in New Issue
	
	Block a user