From f688d7a933d3f88a5d8e16bfc5770df839f12042 Mon Sep 17 00:00:00 2001 From: okayurisotto Date: Sun, 2 Jul 2023 14:11:27 +0900 Subject: [PATCH] =?UTF-8?q?WIP(`ApNoteService.ts`):=20`as`=E3=82=92?= =?UTF-8?q?=E3=81=AA=E3=81=8F=E3=81=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit エラーメッセージを考える --- .../backend/src/core/activitypub/models/ApNoteService.ts | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/packages/backend/src/core/activitypub/models/ApNoteService.ts b/packages/backend/src/core/activitypub/models/ApNoteService.ts index 3a54aec536..0d50adbf30 100644 --- a/packages/backend/src/core/activitypub/models/ApNoteService.ts +++ b/packages/backend/src/core/activitypub/models/ApNoteService.ts @@ -360,10 +360,9 @@ export class ApNoteService { updatedAt: new Date(), }); - return await this.emojisRepository.findOneBy({ - host, - name, - }) as Emoji; + const emoji = await this.emojisRepository.findOneBy({ host, name }); + if (emoji == null) throw new Error(''); // TODO + return emoji; } return exists;