mirror of
https://github.com/n8n-io/n8n.git
synced 2024-11-10 14:44:05 -08:00
🔀 Merge branch 'airmoi-139-null-returnValues'
This commit is contained in:
commit
bb487c9d96
|
@ -276,7 +276,7 @@ export default mixins(
|
|||
returnValue = this.expressionValueComputed;
|
||||
}
|
||||
|
||||
if (returnValue !== undefined && this.parameter.type === 'string') {
|
||||
if (returnValue !== undefined && returnValue !== null && this.parameter.type === 'string') {
|
||||
const rows = this.getArgument('rows');
|
||||
if (rows === undefined || rows === 1) {
|
||||
returnValue = returnValue.toString().replace(/\n/, '|');
|
||||
|
|
|
@ -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) {
|
||||
// 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 (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) {
|
||||
return this.convertObjectValueToString(returnValue);
|
||||
}
|
||||
}
|
||||
|
||||
if (returnObjectAsString === true && typeof returnValue === 'object') {
|
||||
return this.convertObjectValueToString(returnValue);
|
||||
}
|
||||
|
||||
return returnValue;
|
||||
} catch (e) {
|
||||
throw new Error('Expression is not valid.');
|
||||
|
|
Loading…
Reference in a new issue