mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-20 11:22:15 +00:00
⚡ Improve handling of incorrect return data of Function Nodes
This commit is contained in:
@@ -324,7 +324,7 @@ export default mixins(
|
||||
},
|
||||
jsonData (): IDataObject[] {
|
||||
const inputData = this.getNodeInputData(this.node, this.runIndex, this.outputIndex);
|
||||
if (inputData.length === 0) {
|
||||
if (inputData.length === 0 || !Array.isArray(inputData)) {
|
||||
return [];
|
||||
}
|
||||
|
||||
|
||||
@@ -226,7 +226,7 @@ export const nodeHelpers = mixins(
|
||||
|
||||
// Returns the data of the main input
|
||||
getMainInputData (connectionsData: ITaskDataConnections, outputIndex: number): INodeExecutionData[] {
|
||||
if (!connectionsData || !connectionsData.hasOwnProperty('main') || connectionsData.main === undefined || connectionsData.main.length < outputIndex) {
|
||||
if (!connectionsData || !connectionsData.hasOwnProperty('main') || connectionsData.main === undefined || connectionsData.main.length < outputIndex || connectionsData.main[outputIndex] === null) {
|
||||
return [];
|
||||
}
|
||||
return connectionsData.main[outputIndex] as INodeExecutionData[];
|
||||
|
||||
Reference in New Issue
Block a user