mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-17 10:02:05 +00:00
🔀 Merge branch '139-null-returnValues' of https://github.com/airmoi/n8n into airmoi-139-null-returnValues
This commit is contained in:
@@ -890,16 +890,16 @@ export class Workflow {
|
||||
// Execute the expression
|
||||
try {
|
||||
const returnValue = tmpl.tmpl(parameterValue, dataProxy.getDataProxy());
|
||||
if (typeof returnValue === 'object' && Object.keys(returnValue).length === 0) {
|
||||
if (returnValue !== null && typeof returnValue === 'object') {
|
||||
if (Object.keys(returnValue).length === 0) {
|
||||
// When expression is incomplete it returns a Proxy which causes problems.
|
||||
// Catch it with this code and return a proper error.
|
||||
throw new Error('Expression is not valid.');
|
||||
}
|
||||
|
||||
if (returnObjectAsString === true && typeof returnValue === 'object') {
|
||||
if (returnObjectAsString === true) {
|
||||
return this.convertObjectValueToString(returnValue);
|
||||
}
|
||||
|
||||
}
|
||||
return returnValue;
|
||||
} catch (e) {
|
||||
throw new Error('Expression is not valid.');
|
||||
|
||||
Reference in New Issue
Block a user