From f4986cdd1ec5087b9719acf0170702d5575a6eca Mon Sep 17 00:00:00 2001 From: Erik Jan de Wit Date: Mon, 21 Aug 2023 15:32:59 +0200 Subject: [PATCH] added null check for empty policies --- .../src/clients/authorization/ResourcesPolicySelect.tsx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/js/apps/admin-ui/src/clients/authorization/ResourcesPolicySelect.tsx b/js/apps/admin-ui/src/clients/authorization/ResourcesPolicySelect.tsx index f2fe6ad395..e6dcc30bdb 100644 --- a/js/apps/admin-ui/src/clients/authorization/ResourcesPolicySelect.tsx +++ b/js/apps/admin-ui/src/clients/authorization/ResourcesPolicySelect.tsx @@ -181,7 +181,9 @@ export const ResourcesPolicySelect = ({ {field.value?.map((permissionId) => { const item = items.find( (permission) => permission.id === permissionId, - )!; + ); + + if (!item) return; const route = to(item); return (