mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-17 10:02:05 +00:00
⚡ Tolerate missing json key in function node output (#2885)
* 🔨 implemented Tolerate missing json key in function node output * 🔨 clean up * Small change to code * ⚡ tolerate returning object * ⚡ Rename function Co-authored-by: Omar Ajoue <krynble@gmail.com> Co-authored-by: Jan Oberhauser <jan.oberhauser@gmail.com>
This commit is contained in:
@@ -119,6 +119,8 @@ return items;`,
|
||||
try {
|
||||
// Execute the function code
|
||||
items = (await vm.run(`module.exports = async function() {${functionCode}\n}()`, __dirname));
|
||||
items = this.helpers.normalizeItems(items);
|
||||
|
||||
// Do very basic validation of the data
|
||||
if (items === undefined) {
|
||||
throw new NodeOperationError(this.getNode(), 'No data got returned. Always return an Array of items!');
|
||||
|
||||
Reference in New Issue
Block a user