mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-28 03:36:44 +00:00
Add check to prevent undefined access during action validation (#8257)
This commit is contained in:
parent
4d6c11ce31
commit
69d0a22091
@ -96,8 +96,14 @@ export interface EditSubElementEvent {
|
||||
}
|
||||
|
||||
export const actionConfigStruct = dynamic((_value, ctx) => {
|
||||
const test = actionConfigMap[ctx.branch[0][ctx.path[0]].action];
|
||||
return test || actionConfigStructType;
|
||||
if (ctx.branch[0][ctx.path[0]]) {
|
||||
return (
|
||||
actionConfigMap[ctx.branch[0][ctx.path[0]].action] ||
|
||||
actionConfigStructType
|
||||
);
|
||||
}
|
||||
|
||||
return actionConfigStructType;
|
||||
});
|
||||
|
||||
const actionConfigStructUser = object({
|
||||
|
Loading…
x
Reference in New Issue
Block a user