diff --git a/packages/backend/src/remote/activitypub/db-resolver.ts b/packages/backend/src/remote/activitypub/db-resolver.ts index d8aa3b706..961d67ceb 100644 --- a/packages/backend/src/remote/activitypub/db-resolver.ts +++ b/packages/backend/src/remote/activitypub/db-resolver.ts @@ -206,12 +206,17 @@ export default class DbResolver { } public async refetchPublicKeyForApId(user: CacheableRemoteUser): Promise { - await updatePerson(user.uri!, undefined, undefined, user); - let key = await UserPublickeys.findOneBy({ userId: user.id }); - if (key != null) { - await publicKeyByUserIdCache.set(user.id, key); + try { + await updatePerson(user.uri!, undefined, undefined, user); + let key = await UserPublickeys.findOneBy({ userId: user.id }); + if (key != null) { + await publicKeyByUserIdCache.set(user.id, key); + } + return key; + } + catch { + return null; } - return key; } }