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

(cherry picked from commit 9a11139)
  • Loading branch information
chiragsalian authored and OSBotify committed Aug 29, 2023
1 parent 5bc7bf3 commit aa9155c
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 @@ -1219,7 +1219,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 aa9155c

Please sign in to comment.