Skip to content

Commit

Permalink
fix(tagsdiv): ensure there's empty array to sort (#897)
Browse files Browse the repository at this point in the history
  • Loading branch information
rxri authored Feb 15, 2025
1 parent a746dc8 commit bd1fe47
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/components/Card/TagsDiv.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ const TagsDiv = (props: {
}, []);
};
// Sort tags so that externalJS and archived tags come first
let baseTags = props.tags.sort((a) => (a === t("grid.externalJS") || a === t("grid.archived") ? -1 : 1));
let baseTags = [...(props.tags ?? [])].sort((a) => (a === t("grid.externalJS") || a === t("grid.archived") ? -1 : 1));
let extraTags: string[] = [];
// If there are more than one extra tags, slice them and add an expand button
if (baseTags.length - MAX_TAGS > 1) {
Expand Down

0 comments on commit bd1fe47

Please sign in to comment.