Add check to prevent undefined access during action validation (#8257)

This commit is contained in:
Philip Allgaier 2021-01-27 18:39:03 +01:00 committed by GitHub
parent 4d6c11ce31
commit 69d0a22091
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -96,8 +96,14 @@ export interface EditSubElementEvent {
} }
export const actionConfigStruct = dynamic((_value, ctx) => { export const actionConfigStruct = dynamic((_value, ctx) => {
const test = actionConfigMap[ctx.branch[0][ctx.path[0]].action]; if (ctx.branch[0][ctx.path[0]]) {
return test || actionConfigStructType; return (
actionConfigMap[ctx.branch[0][ctx.path[0]].action] ||
actionConfigStructType
);
}
return actionConfigStructType;
}); });
const actionConfigStructUser = object({ const actionConfigStructUser = object({