Skip to content

Commit

Permalink
Move the default to where we use the undefined value
Browse files Browse the repository at this point in the history
  • Loading branch information
flodnv committed Apr 19, 2023
1 parent 85d5c29 commit 0e64b41
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/libs/SidebarUtils.js
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,7 @@ function getOptionData(reportID) {
};

const participantPersonalDetailList = _.values(OptionsListUtils.getPersonalDetailsForLogins(report.participants, personalDetails));
const personalDetail = participantPersonalDetailList[0] || {login: ''};
const personalDetail = participantPersonalDetailList[0] || {};

result.isChatRoom = ReportUtils.isChatRoom(report);
result.isArchivedRoom = ReportUtils.isArchivedRoom(report);
Expand All @@ -252,7 +252,7 @@ function getOptionData(reportID) {
const hasMultipleParticipants = participantPersonalDetailList.length > 1 || result.isChatRoom || result.isPolicyExpenseChat;
const subtitle = ReportUtils.getChatRoomSubtitle(report, policies);

const login = Str.removeSMSDomain(personalDetail.login);
const login = Str.removeSMSDomain(personalDetail.login || '');
const formattedLogin = Str.isSMSLogin(login) ? LocalePhoneNumber.formatPhoneNumber(login) : login;

// We only create tooltips for the first 10 users or so since some reports have hundreds of users, causing performance to degrade.
Expand Down

0 comments on commit 0e64b41

Please sign in to comment.