diff --git a/src/libs/OptionsListUtils.ts b/src/libs/OptionsListUtils.ts index 6cc0c44070ed..9b30764b065d 100644 --- a/src/libs/OptionsListUtils.ts +++ b/src/libs/OptionsListUtils.ts @@ -529,8 +529,8 @@ function getAllReportErrors(report: OnyxEntry, reportActions: OnyxEntry< return Object.assign(prevReportActionErrors, action.errors); }, {}); - const parentReportAction: OnyxEntry | null = - !report?.parentReportID || !report?.parentReportActionID ? null : allReportActions?.[report.parentReportID ?? '']?.[report.parentReportActionID ?? ''] ?? null; + const parentReportAction: OnyxEntry = + !report?.parentReportID || !report?.parentReportActionID ? undefined : allReportActions?.[report.parentReportID ?? '']?.[report.parentReportActionID ?? '']; if (ReportActionUtils.wasActionTakenByCurrentUser(parentReportAction) && ReportActionUtils.isTransactionThread(parentReportAction)) { const transactionID = parentReportAction?.actionName === CONST.REPORT.ACTIONS.TYPE.IOU ? parentReportAction?.originalMessage?.IOUTransactionID : null; diff --git a/src/libs/actions/User.ts b/src/libs/actions/User.ts index 5dc1b72b0bee..c70eb73ec2a5 100644 --- a/src/libs/actions/User.ts +++ b/src/libs/actions/User.ts @@ -61,7 +61,7 @@ Onyx.connect({ }, }); -let myPersonalDetails: OnyxEntry | EmptyObject | null = {}; +let myPersonalDetails: OnyxEntry | EmptyObject = {}; Onyx.connect({ key: ONYXKEYS.PERSONAL_DETAILS_LIST, callback: (value) => { @@ -69,7 +69,7 @@ Onyx.connect({ return; } - myPersonalDetails = value[currentUserAccountID]; + myPersonalDetails = value[currentUserAccountID] ?? {}; }, });