From a63d411b790a1c5ce1633128dff38ae9392d7099 Mon Sep 17 00:00:00 2001 From: Matteo Dal Zovo Date: Mon, 28 Mar 2022 11:24:21 +0200 Subject: [PATCH] fix: optional chaining on item avatar --- src/views/app/folder-panel/lists-item/item-avatar.jsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/views/app/folder-panel/lists-item/item-avatar.jsx b/src/views/app/folder-panel/lists-item/item-avatar.jsx index d55cd6466..45d9c29c7 100644 --- a/src/views/app/folder-panel/lists-item/item-avatar.jsx +++ b/src/views/app/folder-panel/lists-item/item-avatar.jsx @@ -22,7 +22,7 @@ export const ItemAvatar = ({ item, selected, selecting, toggle, folderId, isSear const targetParticipants = folderId === '5' ? ParticipantRole.TO : ParticipantRole.FROM; const [t] = useTranslation(); const [avatarLabel, avatarEmail] = useMemo(() => { - let sender = item.participants.find((p) => p.type === targetParticipants); + let sender = item?.participants?.find((p) => p.type === targetParticipants); if (!sender) [sender] = item.participants; return [sender.fullName || sender.name || sender.address || '.', sender.address]; }, [item.participants, targetParticipants]);