Do not allow that expressions return functions

This commit is contained in:
Jan Oberhauser 2020-04-12 18:48:41 +02:00
parent 09e528565f
commit 59798ad0bd

View file

@ -906,7 +906,9 @@ export class Workflow {
// Execute the expression
try {
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) {
return this.convertObjectValueToString(returnValue);
}