Skip to content

Commit

Permalink
Merge pull request #41363 from Expensify/francois-check-personal-details
Browse files Browse the repository at this point in the history
Use default value for `personalDetails` in `OptionListContextProvider`

(cherry picked from commit 9030a68)
  • Loading branch information
luacmartins authored and OSBotify committed Apr 30, 2024
1 parent 55bd903 commit 64922ae
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/components/OptionListContextProvider.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down Expand Up @@ -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);

Expand Down

0 comments on commit 64922ae

Please sign in to comment.