Skip to content

Commit 5292d41

Browse files
committed
Fix catalog category sorting
1 parent aae5133 commit 5292d41

File tree

1 file changed

+1
-1
lines changed
  • frontend/packages/console-shared/src/components/catalog/catalog-view

1 file changed

+1
-1
lines changed

frontend/packages/console-shared/src/components/catalog/catalog-view/CatalogView.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ const CatalogView: React.FC<CatalogViewProps> = ({
155155
const otherCategory = { id: OTHER_CATEGORY, label: t('console-shared~Other') };
156156
const sortedCategories = (categories ?? [])
157157
.filter((cat) => cat && cat.id !== ALL_CATEGORY && cat.id !== OTHER_CATEGORY)
158-
.sort((a, b) => a.label.localeCompare(b.label));
158+
.sort((a, b) => (a.label ?? '').localeCompare(b.label ?? '') ?? 0);
159159
return [allCategory, ...sortedCategories, otherCategory];
160160
}, [categories, t]);
161161

0 commit comments

Comments
 (0)