mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-17 18:12:04 +00:00
fix(editor): Avoid infinite loops when resolving the expression {{ $parameter }} (no-changelog) (#6855)
Co-authored-by: Oleg Ivaniv <me@olegivaniv.com>
This commit is contained in:
committed by
GitHub
parent
adcf5a96e8
commit
8126181e18
@@ -27,6 +27,7 @@ import * as NodeHelpers from './NodeHelpers';
|
||||
import { ExpressionError } from './ExpressionError';
|
||||
import type { Workflow } from './Workflow';
|
||||
import { augmentArray, augmentObject } from './AugmentObject';
|
||||
import { deepCopy } from './utils';
|
||||
|
||||
export function isResourceLocatorValue(value: unknown): value is INodeParameterResourceLocator {
|
||||
return Boolean(
|
||||
@@ -213,6 +214,8 @@ export class WorkflowDataProxy {
|
||||
},
|
||||
get(target, name, receiver) {
|
||||
if (name === 'isProxy') return true;
|
||||
if (name === 'toJSON') return () => deepCopy(target);
|
||||
|
||||
name = name.toString();
|
||||
|
||||
let returnValue: NodeParameterValueType;
|
||||
@@ -231,6 +234,9 @@ export class WorkflowDataProxy {
|
||||
returnValue = node.parameters[name];
|
||||
}
|
||||
|
||||
// Avoid recursion
|
||||
if (returnValue === `={{ $parameter.${name} }}`) return undefined;
|
||||
|
||||
if (isResourceLocatorValue(returnValue)) {
|
||||
if (returnValue.__regex && typeof returnValue.value === 'string') {
|
||||
const expr = new RegExp(returnValue.__regex);
|
||||
|
||||
Reference in New Issue
Block a user