From c3456c027a0a479d0a4de0f9bc5e60aedb779c40 Mon Sep 17 00:00:00 2001 From: Kainoa Kanter Date: Fri, 26 May 2023 16:32:59 +0000 Subject: [PATCH] hotfix: try catch hasUnreadAntenna --- packages/backend/src/models/repositories/user.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/packages/backend/src/models/repositories/user.ts b/packages/backend/src/models/repositories/user.ts index 40760e8ee..5e0b83792 100644 --- a/packages/backend/src/models/repositories/user.ts +++ b/packages/backend/src/models/repositories/user.ts @@ -256,7 +256,8 @@ export const UserRepository = db.getRepository(User).extend({ }, async getHasUnreadAntenna(userId: User["id"]): Promise { - const myAntennas = (await getAntennas()).filter((a) => a.userId === userId); + try { + const myAntennas = (await getAntennas()).filter((a) => a.userId === userId); const unread = myAntennas.length > 0 @@ -266,7 +267,7 @@ export const UserRepository = db.getRepository(User).extend({ }) : null; - return unread != null; + return unread != null; } catch(e) { return false; } }, async getHasUnreadChannel(userId: User["id"]): Promise {