From 9988b676c392c1e7d9822b3f951e7abbc489a1f6 Mon Sep 17 00:00:00 2001 From: Kiran Ashok Date: Fri, 26 May 2023 10:55:40 +0530 Subject: [PATCH] fix :: check for if control component event with no component selected (#6282) --- frontend/src/_helpers/appUtils.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/frontend/src/_helpers/appUtils.js b/frontend/src/_helpers/appUtils.js index 480f30ecb1..4c638ed158 100644 --- a/frontend/src/_helpers/appUtils.js +++ b/frontend/src/_helpers/appUtils.js @@ -551,12 +551,12 @@ function executeActionWithDebounce(_ref, event, mode, customVariables) { const component = Object.values(_ref.state.currentState?.components ?? {}).filter( (component) => component.id === event.componentId )[0]; - const action = component[event.componentSpecificActionHandle]; + const action = component?.[event.componentSpecificActionHandle]; const actionArguments = _.map(event.componentSpecificActionParams, (param) => ({ ...param, value: resolveReferences(param.value, _ref.state.currentState, undefined, customVariables), })); - const actionPromise = action(...actionArguments.map((argument) => argument.value)); + const actionPromise = actionArguments?.length && action(...actionArguments.map((argument) => argument.value)); return actionPromise ?? Promise.resolve(); }