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

@@ -92,6 +92,11 @@ export class FunctionItem implements INodeType {
return Promise.reject(e);
}
// Do very basic validation of the data
if (jsonData === undefined) {
throw new Error('No data got returned. Always an object has to be returned!');
}
return {
json: jsonData
};