From 3d062b9ca49ac13748ea297e86d24df7f4ae15f0 Mon Sep 17 00:00:00 2001 From: Travis Tidwell Date: Wed, 3 Jul 2024 11:24:41 -0500 Subject: [PATCH] Fixed an issue where the 'root' may be the component that does not have a getComponent method. --- src/utils/conditionOperators/DateGreaterThan.js | 2 +- src/utils/conditionOperators/IsEmptyValue.js | 2 +- src/utils/conditionOperators/IsEqualTo.js | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) 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 d1c280680f..2a0c6a0baa 100644 --- a/src/utils/conditionOperators/IsEmptyValue.js +++ b/src/utils/conditionOperators/IsEmptyValue.js @@ -17,7 +17,7 @@ export default class IsEmptyValue extends ConditionOperator { execute({ value, instance, conditionComponentPath }) { const isEmptyValue = _.isEmpty(value); - if (instance && instance.root) { + if (instance?.root?.getComponent) { const conditionTriggerComponent = instance.root.getComponent(conditionComponentPath); return conditionTriggerComponent ? conditionTriggerComponent.isEmpty() : isEmptyValue; } diff --git a/src/utils/conditionOperators/IsEqualTo.js b/src/utils/conditionOperators/IsEqualTo.js index d8eece5f12..a577fc7413 100644 --- a/src/utils/conditionOperators/IsEqualTo.js +++ b/src/utils/conditionOperators/IsEqualTo.js @@ -20,7 +20,7 @@ export default class IsEqualTo extends ConditionOperator { catch (e) {} } - if (instance && instance.root) { + if (instance?.root?.getComponent) { const conditionTriggerComponent = instance.root.getComponent(conditionComponentPath); if (