From 6a390e3fd1b21c99d08c6825cfb21c7856eb5e01 Mon Sep 17 00:00:00 2001 From: Francois Laithier Date: Thu, 2 May 2024 12:12:46 -0700 Subject: [PATCH] Merge pull request #41526 from dragnoir/41504-fix (cherry picked from commit d07829b85ff0ce8b4e6a1573a5f1dd6b3fe73282) --- src/pages/home/report/ReportActionsList.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/pages/home/report/ReportActionsList.tsx b/src/pages/home/report/ReportActionsList.tsx index 5d4ba47877d1..7d95d3555502 100644 --- a/src/pages/home/report/ReportActionsList.tsx +++ b/src/pages/home/report/ReportActionsList.tsx @@ -454,9 +454,9 @@ function ReportActionsList({ ); const shouldUseThreadDividerLine = useMemo(() => { - const topReport = sortedVisibleReportActions[sortedVisibleReportActions.length - 1]; + const topReport = sortedVisibleReportActions.length > 0 ? sortedVisibleReportActions[sortedVisibleReportActions.length - 1] : null; - if (topReport.actionName !== CONST.REPORT.ACTIONS.TYPE.CREATED) { + if (topReport && topReport.actionName !== CONST.REPORT.ACTIONS.TYPE.CREATED) { return false; }