Skip to content

Commit

Permalink
Merge pull request #26257 from Expensify/cmartins-fixInvalidObjectAccess
Browse files Browse the repository at this point in the history
Fix null reports
  • Loading branch information
chiragsalian authored Aug 29, 2023
2 parents cf1d50a + c38ab0e commit 9a11139
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/libs/ReportUtils.js
Original file line number Diff line number Diff line change
Expand Up @@ -1255,7 +1255,8 @@ function getMoneyRequestReportName(report, policy = undefined) {
* @returns {Object}
*/
function getReport(reportID) {
return lodashGet(allReports, `${ONYXKEYS.COLLECTION.REPORT}${reportID}`, {});
// Deleted reports are set to null and lodashGet will still return null in that case, so we need to add an extra check
return lodashGet(allReports, `${ONYXKEYS.COLLECTION.REPORT}${reportID}`, {}) || {};
}

/**
Expand Down

0 comments on commit 9a11139

Please sign in to comment.