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