From c38ab0e19aaca72dcc883744e0dc01dc12de0197 Mon Sep 17 00:00:00 2001 From: Carlos Martins Date: Tue, 29 Aug 2023 14:47:45 -0600 Subject: [PATCH] add null check --- src/libs/ReportUtils.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/libs/ReportUtils.js b/src/libs/ReportUtils.js index d41a31c5bae7..3bd63fc0a073 100644 --- a/src/libs/ReportUtils.js +++ b/src/libs/ReportUtils.js @@ -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}`, {}) || {}; } /**