Skip to content

Commit

Permalink
refactor: add null in category filter for undefined properties
Browse files Browse the repository at this point in the history
  • Loading branch information
ArekChr committed Mar 18, 2024
1 parent 7a496c8 commit a15c5a4
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/pages/workspace/categories/WorkspaceCategoriesPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ function WorkspaceCategoriesPage({policy, policyCategories, route}: WorkspaceCat
onSelected: () => setDeleteCategoriesConfirmModalVisible(true),
});

const enabledCategories = selectedCategoriesArray.filter((categoryName) => policyCategories?.[categoryName].enabled);
const enabledCategories = selectedCategoriesArray.filter((categoryName) => policyCategories?.[categoryName]?.enabled);
if (enabledCategories.length > 0) {
const categoriesToDisable = selectedCategoriesArray
.filter((categoryName) => policyCategories?.[categoryName].enabled)
Expand Down

0 comments on commit a15c5a4

Please sign in to comment.