From 5da2ece9bf8e0b50dc086dfe5406764162408fc3 Mon Sep 17 00:00:00 2001 From: Cong Pham Date: Wed, 1 May 2024 02:39:38 +0700 Subject: [PATCH] get default value for personalDetails --- 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);