Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Omit default Avatar param to prevent crash on app start #11006

Merged
merged 1 commit into from
Sep 15, 2022
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
2 changes: 1 addition & 1 deletion src/libs/OptionsListUtils.js
Original file line number Diff line number Diff line change
@@ -349,7 +349,7 @@ function createOption(logins, personalDetails, report, reportActions = {}, {
result.text = reportName;
result.subtitle = subtitle;
result.participantsList = personalDetailList;
result.icons = ReportUtils.getIcons(report, personalDetails, policies, personalDetail.avatar);
result.icons = ReportUtils.getIcons(report, personalDetails, policies);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

NAB what about making this:

Suggested change
result.icons = ReportUtils.getIcons(report, personalDetails, policies);
result.icons = ReportUtils.getIcons(report, personalDetails, policies, personalDetail && personalDetail.avatar);

Copy link
Contributor

@Beamanator Beamanator Sep 15, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Or changing const personalDetail = personalDetailList[0]; above to const personalDetail = personalDetailList[0] || {};?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The getIcons function falls back to a default icon anyway, and the param has a default. But yeah, that might have been better... Maybe you could submit a follow up if the test passes.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Submitted a PR for this here, because it was found to create a new blocker.

result.searchText = getSearchText(report, reportName, personalDetailList, result.isChatRoom || result.isPolicyExpenseChat);

return result;