From 26d668b47884681d8ea37499b762b05ee96f0f19 Mon Sep 17 00:00:00 2001 From: lebaudantoine Date: Sun, 20 Jul 2025 17:55:38 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B(frontend)=20prevent=20Crisp=20cras?= =?UTF-8?q?h=20when=20superuser=20has=20no=20email?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fix crash when switching from admin session to app with superuser account that lacks email field. Add null check to prevent Crisp initialization errors. --- src/frontend/src/features/support/hooks/useSupport.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/frontend/src/features/support/hooks/useSupport.tsx b/src/frontend/src/features/support/hooks/useSupport.tsx index c7c84278..211d6767 100644 --- a/src/frontend/src/features/support/hooks/useSupport.tsx +++ b/src/frontend/src/features/support/hooks/useSupport.tsx @@ -7,7 +7,7 @@ export const initializeSupportSession = (user: ApiUser) => { if (!Crisp.isCrispInjected()) return const { id, email } = user Crisp.setTokenId(`meet-${id}`) - Crisp.user.setEmail(email) + if (email) Crisp.user.setEmail(email) } export const terminateSupportSession = () => {