fix(acl): add optional chaining to prevent potential null/undefined error in uiButtonSchemasBlacklist check

This commit is contained in:
Zeke Zhang 2025-02-28 07:02:10 +08:00
parent bf624922f0
commit bea0a2c524

View File

@ -321,7 +321,7 @@ export const ACLActionProvider = (props) => {
() => actionPath && parseAction(actionPath, { schema, recordPkValue }),
[parseAction, actionPath, schema, recordPkValue],
);
if (uiButtonSchemasBlacklist.includes(currentUid)) {
if (uiButtonSchemasBlacklist?.includes(currentUid)) {
return <ACLActionParamsContext.Provider value={false}>{props.children}</ACLActionParamsContext.Provider>;
}
if (!actionPath) {