fix :: check for if control component event with no component selected (#6282)

This commit is contained in:
Kiran Ashok 2023-05-26 10:55:40 +05:30 committed by GitHub
parent bf48e0b565
commit 9988b676c3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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();
}