From 4cc4da5f3ad6353d910a260a88c8e5423e5f1e75 Mon Sep 17 00:00:00 2001 From: Carlos Martins Date: Wed, 2 Jul 2025 12:06:13 -0400 Subject: [PATCH 1/2] add safeguard --- src/components/Search/SearchAutocompleteList.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/components/Search/SearchAutocompleteList.tsx b/src/components/Search/SearchAutocompleteList.tsx index 44f512c4461c..42536c1bac5e 100644 --- a/src/components/Search/SearchAutocompleteList.tsx +++ b/src/components/Search/SearchAutocompleteList.tsx @@ -226,7 +226,7 @@ function SearchAutocompleteList( .map((details) => { return { name: details.displayName ?? Str.removeSMSDomain(details.login ?? ''), - accountID: details.accountID.toString(), + accountID: details?.accountID?.toString(), }; }); @@ -424,7 +424,7 @@ function SearchAutocompleteList( return filteredCards.map((card) => ({ filterKey: CONST.SEARCH.SEARCH_USER_FRIENDLY_KEYS.CARD_ID, text: getCardDescription(card.cardID, allCards), - autocompleteID: card.cardID.toString(), + autocompleteID: card?.cardID?.toString(), mapKey: CONST.SEARCH.SYNTAX_FILTER_KEYS.CARD_ID, })); } From 925dc29d85e4814afd78bc5de654c3d5ba61ed34 Mon Sep 17 00:00:00 2001 From: Carlos Martins Date: Wed, 2 Jul 2025 12:08:34 -0400 Subject: [PATCH 2/2] add safeguard --- src/components/Search/SearchAutocompleteList.tsx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/components/Search/SearchAutocompleteList.tsx b/src/components/Search/SearchAutocompleteList.tsx index 42536c1bac5e..9d64f194132c 100644 --- a/src/components/Search/SearchAutocompleteList.tsx +++ b/src/components/Search/SearchAutocompleteList.tsx @@ -226,7 +226,7 @@ function SearchAutocompleteList( .map((details) => { return { name: details.displayName ?? Str.removeSMSDomain(details.login ?? ''), - accountID: details?.accountID?.toString(), + accountID: details.accountID.toString(), }; }); @@ -304,7 +304,7 @@ function SearchAutocompleteList( case CONST.SEARCH.SYNTAX_FILTER_KEYS.CATEGORY: { const autocompleteList = autocompleteValue ? categoryAutocompleteList : recentCategoriesAutocompleteList; const filteredCategories = autocompleteList - .filter((category) => category.toLowerCase().includes(autocompleteValue.toLowerCase()) && !alreadyAutocompletedKeys.includes(category.toLowerCase())) + .filter((category) => category?.toLowerCase()?.includes(autocompleteValue?.toLowerCase()) && !alreadyAutocompletedKeys.includes(category?.toLowerCase())) .sort() .slice(0, 10); @@ -424,7 +424,7 @@ function SearchAutocompleteList( return filteredCards.map((card) => ({ filterKey: CONST.SEARCH.SEARCH_USER_FRIENDLY_KEYS.CARD_ID, text: getCardDescription(card.cardID, allCards), - autocompleteID: card?.cardID?.toString(), + autocompleteID: card.cardID.toString(), mapKey: CONST.SEARCH.SYNTAX_FILTER_KEYS.CARD_ID, })); }