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; }