From dbbec876c191ea2151afac506264eeb7752a49bc Mon Sep 17 00:00:00 2001 From: Pedro Howat Date: Thu, 17 Oct 2024 15:00:30 -0300 Subject: [PATCH] Fixes getting 500 errors with some words. --- src/api/integrations/kwik/controllers/kwik.controller.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/api/integrations/kwik/controllers/kwik.controller.ts b/src/api/integrations/kwik/controllers/kwik.controller.ts index 5aca6918..833332c4 100644 --- a/src/api/integrations/kwik/controllers/kwik.controller.ts +++ b/src/api/integrations/kwik/controllers/kwik.controller.ts @@ -300,7 +300,7 @@ export class KwikController { const [...contacts_solved] = await Promise.all([...contacts_promises]); const [...groups_solved] = await Promise.all([...groups_promises]); - const contacts = Object.fromEntries(contacts_solved.map((c) => [`${c.owner}#${c.id}`, c])); + const contacts = Object.fromEntries(contacts_solved.filter((c) => c != null).map((c) => [`${c.owner}#${c.id}`, c])); const groups = Object.fromEntries( groups_solved.filter((g) => g !== null).map((g) => [`${g.instanceName}#${g.id}`, g]), );