From c761435bff0cab3cc8dcbeb9ceb17ee1d84a47d9 Mon Sep 17 00:00:00 2001 From: Yuwen Memon Date: Thu, 13 Jul 2023 14:13:11 -0700 Subject: [PATCH] Make sure we have delegate details before displaying them in the case of a delegate action --- src/pages/home/report/ReportActionItemSingle.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/pages/home/report/ReportActionItemSingle.js b/src/pages/home/report/ReportActionItemSingle.js index 30a02336aa42d..fe2b1406b148e 100644 --- a/src/pages/home/report/ReportActionItemSingle.js +++ b/src/pages/home/report/ReportActionItemSingle.js @@ -82,9 +82,9 @@ function ReportActionItemSingle(props) { displayName = ReportUtils.getPolicyName(props.report); actorHint = displayName; avatarSource = ReportUtils.getWorkspaceAvatar(props.report); - } else if (props.action.delegateAccountID) { - // We replace the actor's email, name, and avatar with the Copilot manually for now. This will be improved upon when - // the Copilot feature is implemented. + } else if (props.action.delegateAccountID && props.personalDetailsList[props.action.delegateAccountID]) { + // We replace the actor's email, name, and avatar with the Copilot manually for now. And only if we have their + // details. This will be improved upon when the Copilot feature is implemented. const delegateDetails = props.personalDetailsList[props.action.delegateAccountID]; const delegateDisplayName = delegateDetails.displayName; actorHint = `${delegateDisplayName} (${props.translate('reportAction.asCopilot')} ${displayName})`;