mirror of
https://github.com/n8n-io/n8n.git
synced 2024-12-25 04:34: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 {
|
try {
|
||||||
// Execute the function code
|
// 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
|
// Do very basic validation of the data
|
||||||
if (items === undefined) {
|
if (items === undefined) {
|
||||||
throw new NodeOperationError(this.getNode(), 'No data got returned. Always return an Array of items!');
|
throw new NodeOperationError(this.getNode(), 'No data got returned. Always return an Array of items!');
|
||||||
|
|
|
@ -114,7 +114,7 @@ return item;`,
|
||||||
let jsonData: IDataObject;
|
let jsonData: IDataObject;
|
||||||
try {
|
try {
|
||||||
// Execute the function code
|
// 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) {
|
} catch (error) {
|
||||||
if (this.continueOnFail()) {
|
if (this.continueOnFail()) {
|
||||||
returnData.push({json:{ error: error.message }});
|
returnData.push({json:{ error: error.message }});
|
||||||
|
|
Loading…
Reference in a new issue