mirror of
https://github.com/n8n-io/n8n.git
synced 2024-12-24 04:04:06 -08:00
🐛 Fix issue with comments in last line
This commit is contained in:
parent
b9abf5c57b
commit
4ab7257c2b
|
@ -102,7 +102,7 @@ return items;`,
|
|||
|
||||
try {
|
||||
// Execute the function code
|
||||
items = (await vm.run(`module.exports = async function() {${functionCode}}()`, __dirname));
|
||||
items = (await vm.run(`module.exports = async function() {${functionCode}\n}()`, __dirname));
|
||||
// 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!');
|
||||
|
|
|
@ -114,7 +114,7 @@ return item;`,
|
|||
let jsonData: IDataObject;
|
||||
try {
|
||||
// Execute the function code
|
||||
jsonData = await vm.run(`module.exports = async function() {${functionCode}}()`, __dirname);
|
||||
jsonData = await vm.run(`module.exports = async function() {${functionCode}\n}()`, __dirname);
|
||||
} catch (error) {
|
||||
if (this.continueOnFail()) {
|
||||
returnData.push({json:{ error: error.message }});
|
||||
|
|
Loading…
Reference in a new issue