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`
  • Loading branch information
luacmartins authored Apr 30, 2024
2 parents c91b27a + 5da2ece commit 9030a68
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 9030a68

Please sign in to comment.