From 64922ae9d2e272b52f5caf976eb258338f10a0c2 Mon Sep 17 00:00:00 2001 From: Carlos Martins Date: Tue, 30 Apr 2024 15:47:43 -0600 Subject: [PATCH] Merge pull request #41363 from Expensify/francois-check-personal-details Use default value for `personalDetails` in `OptionListContextProvider` (cherry picked from commit 9030a68b7ba93bdda408413a81df94c109cc0444) --- src/components/OptionListContextProvider.tsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/components/OptionListContextProvider.tsx b/src/components/OptionListContextProvider.tsx index 89291d02d2f7..b530eecd4d3c 100644 --- a/src/components/OptionListContextProvider.tsx +++ b/src/components/OptionListContextProvider.tsx @@ -5,6 +5,7 @@ import usePrevious from '@hooks/usePrevious'; import * as OptionsListUtils from '@libs/OptionsListUtils'; import type {OptionList} from '@libs/OptionsListUtils'; import * as ReportUtils from '@libs/ReportUtils'; +import CONST from '@src/CONST'; import ONYXKEYS from '@src/ONYXKEYS'; import type {PersonalDetails, Report} from '@src/types/onyx'; import {usePersonalDetails} from './OnyxProvider'; @@ -50,7 +51,7 @@ function OptionsListContextProvider({reports, children}: OptionsListProviderProp personalDetails: [], }); - const personalDetails = usePersonalDetails(); + const personalDetails = usePersonalDetails() || CONST.EMPTY_OBJECT; const prevPersonalDetails = usePrevious(personalDetails); const prevReports = usePrevious(reports);