diff --git a/packages/backend/src/models/repositories/user.ts b/packages/backend/src/models/repositories/user.ts index 40760e8ee4..5e0b83792d 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 {