Skip to content

Commit

Permalink
Merge pull request #57060 from Expensify/francois-fix-crash-category-…
Browse files Browse the repository at this point in the history
…no-name

Safely filter out categories without a name in `SearchMultipleSelectionPicker`

(cherry picked from commit 4c7061b)

(CP triggered by francoisl)
  • Loading branch information
francoisl authored and OSBotify committed Feb 19, 2025
1 parent 02fb522 commit 9ba15b1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/components/Search/SearchMultipleSelectionPicker.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ function SearchMultipleSelectionPicker({items, initiallySelectedItems, pickerTit
value: item.value,
}));
const remainingItemsSection = items
.filter((item) => selectedItems.some((selectedItem) => selectedItem.value === item.value) === false && item?.name.toLowerCase().includes(debouncedSearchTerm?.toLowerCase()))
.filter((item) => selectedItems.some((selectedItem) => selectedItem.value === item.value) === false && item?.name?.toLowerCase().includes(debouncedSearchTerm?.toLowerCase()))
.sort((a, b) => sortOptionsWithEmptyValue(a, b))
.map((item) => ({
text: item.name,
Expand Down

0 comments on commit 9ba15b1

Please sign in to comment.