From 41f65a20f133352ee70ad0e828f4907e289e597b Mon Sep 17 00:00:00 2001 From: HinanoAira Date: Thu, 5 Sep 2024 23:34:41 +0900 Subject: [PATCH] =?UTF-8?q?fix:=20=E9=80=9A=E7=9F=A5=E3=81=8B=E3=82=89?= =?UTF-8?q?=E3=83=AD=E3=83=BC=E3=83=AB=E5=8F=82=E7=85=A7=E6=99=82=E3=81=AB?= =?UTF-8?q?=E3=83=AD=E3=83=BC=E3=83=AB=E3=81=8C=E5=AD=98=E5=9C=A8=E3=81=97?= =?UTF-8?q?=E3=81=AA=E3=81=84=E3=81=A8=E3=81=8D=E3=81=AE=E4=BE=8B=E5=A4=96?= =?UTF-8?q?=E5=87=A6=E7=90=86=E3=82=92=E8=BF=BD=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../backend/src/core/entities/NotificationEntityService.ts | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/packages/backend/src/core/entities/NotificationEntityService.ts b/packages/backend/src/core/entities/NotificationEntityService.ts index f393513510..c4ddb6efa8 100644 --- a/packages/backend/src/core/entities/NotificationEntityService.ts +++ b/packages/backend/src/core/entities/NotificationEntityService.ts @@ -59,7 +59,6 @@ export class NotificationEntityService implements OnModuleInit { async #packInternal ( src: T, meId: MiUser['id'], - // eslint-disable-next-line @typescript-eslint/ban-types options: { checkValidNotifier?: boolean; }, @@ -140,7 +139,10 @@ export class NotificationEntityService implements OnModuleInit { // #endregion const needsRole = notification.type === 'roleAssigned'; - const role = needsRole ? await this.roleEntityService.pack(notification.roleId) : undefined; + const role = needsRole ? await this.roleEntityService.pack(notification.roleId).catch((e) => { + if (e.name === 'EntityNotFoundError') return null; + throw e; + }) : undefined; // if the role has been deleted, don't show this notification if (needsRole && !role) { return null; @@ -229,7 +231,6 @@ export class NotificationEntityService implements OnModuleInit { public async pack( src: MiNotification | MiGroupedNotification, meId: MiUser['id'], - // eslint-disable-next-line @typescript-eslint/ban-types options: { checkValidNotifier?: boolean; },