From 32542baf6cafbbc46ec112c59f4290e2406d1e51 Mon Sep 17 00:00:00 2001 From: nkdengineer Date: Mon, 16 Sep 2024 17:50:29 +0700 Subject: [PATCH] fix: app crash when we save the user search value and reset the app --- src/libs/SearchUtils.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libs/SearchUtils.ts b/src/libs/SearchUtils.ts index 24872b5d90eb..7740c6aadcc3 100644 --- a/src/libs/SearchUtils.ts +++ b/src/libs/SearchUtils.ts @@ -699,7 +699,7 @@ function getPolicyIDFromSearchQuery(queryJSON: SearchQueryJSON) { function getDisplayValue(filterName: string, filter: string, personalDetails: OnyxTypes.PersonalDetailsList, cardList: OnyxTypes.CardList, reports: OnyxCollection) { if (filterName === CONST.SEARCH.SYNTAX_FILTER_KEYS.FROM || filterName === CONST.SEARCH.SYNTAX_FILTER_KEYS.TO) { - return PersonalDetailsUtils.createDisplayName(personalDetails[filter]?.login ?? '', personalDetails[filter]); + return PersonalDetailsUtils.createDisplayName(personalDetails?.[filter]?.login ?? '', personalDetails?.[filter]); } if (filterName === CONST.SEARCH.SYNTAX_FILTER_KEYS.CARD_ID) { return cardList[filter].bank;