diff --git a/src/utils/conditionOperators/DateGreaterThan.js b/src/utils/conditionOperators/DateGreaterThan.js index 81eda99fea..8324ce7025 100644 --- a/src/utils/conditionOperators/DateGreaterThan.js +++ b/src/utils/conditionOperators/DateGreaterThan.js @@ -26,7 +26,7 @@ export default class DateGeaterThan extends ConditionOperator { let conditionTriggerComponent = null; - if (instance && instance.root) { + if (instance?.root?.getComponent) { conditionTriggerComponent = instance.root.getComponent(conditionComponentPath); } diff --git a/src/utils/conditionOperators/IsEmptyValue.js b/src/utils/conditionOperators/IsEmptyValue.js index 11c90a2125..5514771721 100644 --- a/src/utils/conditionOperators/IsEmptyValue.js +++ b/src/utils/conditionOperators/IsEmptyValue.js @@ -17,8 +17,8 @@ export default class IsEmptyValue extends ConditionOperator { execute({ value, instance, conditionComponentPath }) { const isEmptyValue = _.isEmpty(_.isNumber(value)? String(value): value); - if (instance && instance.root) { - const conditionTriggerComponent = instance.root?.getComponent && instance.root.getComponent(conditionComponentPath); + if (instance?.root?.getComponent) { + const conditionTriggerComponent = instance.root.getComponent(conditionComponentPath); return conditionTriggerComponent?.isEmpty ? conditionTriggerComponent.isEmpty() : isEmptyValue; } diff --git a/src/utils/conditionOperators/IsEqualTo.js b/src/utils/conditionOperators/IsEqualTo.js index f732a95cc7..a577fc7413 100644 --- a/src/utils/conditionOperators/IsEqualTo.js +++ b/src/utils/conditionOperators/IsEqualTo.js @@ -20,8 +20,8 @@ export default class IsEqualTo extends ConditionOperator { catch (e) {} } - if (instance && instance.root) { - const conditionTriggerComponent = instance.root?.getComponent && instance.root.getComponent(conditionComponentPath); + if (instance?.root?.getComponent) { + const conditionTriggerComponent = instance.root.getComponent(conditionComponentPath); if ( conditionTriggerComponent