From 7705380cbe107668e2cc1542646940d05c1e7c8b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Th=C3=A9o=20Poizat?= Date: Fri, 15 Nov 2024 17:29:54 +0100 Subject: [PATCH] fix: Use correctly optional chaining to get me me[0] should exist here because every one has me. But after we should use it until the end. --- libs/cozy/sync.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libs/cozy/sync.ts b/libs/cozy/sync.ts index 654f893c2895..dc919dec03ff 100644 --- a/libs/cozy/sync.ts +++ b/libs/cozy/sync.ts @@ -25,7 +25,7 @@ export const shouldDisplayContact = async (client: CozyClient, contact: IOCozyCo const me = await fetchMyself(client); const contactRelatedToMe = // @ts-expect-error related added manually with an hydration - me?.[0]?.relationships?.related?.data.find( + me[0].relationships?.related?.data?.find( // @ts-expect-error related added manually with an hydration (relatedContact) => relatedContact._id === contact._id, );