mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-17 10:02:05 +00:00
⚡ Do not allow that expressions return functions
This commit is contained in:
@@ -906,7 +906,9 @@ export class Workflow {
|
|||||||
// Execute the expression
|
// Execute the expression
|
||||||
try {
|
try {
|
||||||
const returnValue = tmpl.tmpl(parameterValue, data);
|
const returnValue = tmpl.tmpl(parameterValue, data);
|
||||||
if (returnValue !== null && typeof returnValue === 'object') {
|
if (typeof returnValue === 'function') {
|
||||||
|
throw new Error('Expression resolved to a function. Please add "()"');
|
||||||
|
} else if (returnValue !== null && typeof returnValue === 'object') {
|
||||||
if (returnObjectAsString === true) {
|
if (returnObjectAsString === true) {
|
||||||
return this.convertObjectValueToString(returnValue);
|
return this.convertObjectValueToString(returnValue);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user