Improve handling of incorrect return data of Function Nodes

This commit is contained in:
Jan Oberhauser
2019-12-23 14:54:27 -06:00
parent 2b343a4aa5
commit 1ed5a4589d
4 changed files with 33 additions and 3 deletions

View File

@@ -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 [];
}

View File

@@ -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[];