From a6a226719ff3502a1606d47740fd1a3788d681a2 Mon Sep 17 00:00:00 2001 From: dominictb Date: Wed, 7 Aug 2024 15:13:15 +0700 Subject: [PATCH] fix: filter out non-existing members in personal details --- src/pages/ReportDetailsPage.tsx | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/pages/ReportDetailsPage.tsx b/src/pages/ReportDetailsPage.tsx index 88611c600d8f..886a7d21ab2d 100644 --- a/src/pages/ReportDetailsPage.tsx +++ b/src/pages/ReportDetailsPage.tsx @@ -145,6 +145,10 @@ function ReportDetailsPage({policies, report, session, personalDetails}: ReportD // Get the active chat members by filtering out the pending members with delete action const activeChatMembers = participants.flatMap((accountID) => { const pendingMember = report?.pendingChatMembers?.findLast((member) => member.accountID === accountID.toString()); + const detail = personalDetails?.[accountID]; + if (!detail) { + return []; + } return !pendingMember || pendingMember.pendingAction !== CONST.RED_BRICK_ROAD_PENDING_ACTION.DELETE ? accountID : []; });