From 19ea270c23c8ddd4f4c9a398b84518364247c86d Mon Sep 17 00:00:00 2001 From: dragnoir Date: Thu, 2 May 2024 19:25:55 +0100 Subject: [PATCH] Fix regression #41504 --- 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; }