refactor(`ApNoteService.ts`): non-null assertion
これまでは`getApId()`の方でエラーがスローされていた。
This commit is contained in:
parent
acce210f7d
commit
47a07d37f3
|
@ -140,7 +140,11 @@ export class ApNoteService {
|
|||
this.logger.info(`Creating the Note: ${note.id}`);
|
||||
|
||||
// 投稿者をフェッチ
|
||||
const actor = await this.apPersonService.resolvePerson(getOneApId(note.attributedTo!), resolver) as RemoteUser;
|
||||
if (note.attributedTo == null) {
|
||||
throw new Error('invalid note.attributedTo: ' + note.attributedTo);
|
||||
}
|
||||
|
||||
const actor = await this.apPersonService.resolvePerson(getOneApId(note.attributedTo), resolver) as RemoteUser;
|
||||
|
||||
// 投稿者が凍結されていたらスキップ
|
||||
if (actor.isSuspended) {
|
||||
|
|
Loading…
Reference in New Issue