From 57b3d4d4b8c5f984648428fec90ad27319c80c1c Mon Sep 17 00:00:00 2001 From: Ulf Gebhardt Date: Thu, 3 Apr 2025 00:51:07 +0200 Subject: [PATCH] properly handle null case for email destructuring --- backend/src/middleware/notifications/notificationsMiddleware.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/backend/src/middleware/notifications/notificationsMiddleware.ts b/backend/src/middleware/notifications/notificationsMiddleware.ts index a17196996..29eff6cf3 100644 --- a/backend/src/middleware/notifications/notificationsMiddleware.ts +++ b/backend/src/middleware/notifications/notificationsMiddleware.ts @@ -332,7 +332,7 @@ const handleCreateMessage = async (resolve, root, args, context, resolveInfo) => return { user: await txResponse.records.map((record) => record.get('recipientUser'))[0], - email: await txResponse.records.map((record) => record.get('emailAddress'))[0].email, + email: await txResponse.records.map((record) => record.get('emailAddress'))[0]?.email, } })