From a0bc6049db1f7162781c1d126c93c7222a181723 Mon Sep 17 00:00:00 2001 From: Vit Horacek <vit@expensify.com> Date: Fri, 20 Jan 2023 22:50:24 +0000 Subject: [PATCH] Default to empty object in case report actions are missing --- src/pages/home/report/ReportActionsList.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pages/home/report/ReportActionsList.js b/src/pages/home/report/ReportActionsList.js index 36638f521dc7..5e61a042193a 100644 --- a/src/pages/home/report/ReportActionsList.js +++ b/src/pages/home/report/ReportActionsList.js @@ -175,7 +175,7 @@ class ReportActionsList extends React.Component { // Make sure the oldest report action loaded is not the first. This is so we do not show the // skeleton view above the created action in a newly generated optimistic chat or one with not // that many comments. - const lastReportAction = _.last(this.props.sortedReportActions); + const lastReportAction = _.last(this.props.sortedReportActions) || {}; if (this.props.report.isLoadingReportActions && lastReportAction.sequenceNumber > 0) { return ( <ReportActionsSkeletonView