Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion src/libs/ReportUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1897,6 +1897,13 @@ function getPersonalDetailsForAccountID(accountID: number): Partial<PersonalDeta
return allPersonalDetails?.[accountID] ?? defaultDetails;
}

/**
* Returns the personal details or a default object if the personal details are not available.
*/
function getPersonalDetailsOrDefault(personalDetails: Partial<PersonalDetails> | undefined | null): Partial<PersonalDetails> {
return personalDetails ?? {isOptimisticPersonalDetail: true};
}

const hiddenTranslation = Localize.translateLocal('common.hidden');

const phoneNumberCache: Record<string, string> = {};
Expand All @@ -1909,7 +1916,7 @@ function getDisplayNameForParticipant(accountID?: number, shouldUseShortForm = f
return '';
}

const personalDetails = getPersonalDetailsForAccountID(accountID);
const personalDetails = getPersonalDetailsOrDefault(allPersonalDetails?.[accountID]);
if (!personalDetails) {
return '';
}
Expand Down