From 6cac291d3d2bb49df5172406fc4185e23fe0327e Mon Sep 17 00:00:00 2001
From: Mar0xy <marie@kaifa.ch>
Date: Tue, 17 Oct 2023 21:08:15 +0200
Subject: [PATCH] fix: relays not getting accepted

---
 .../src/core/activitypub/models/ApPersonService.ts   | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/packages/backend/src/core/activitypub/models/ApPersonService.ts b/packages/backend/src/core/activitypub/models/ApPersonService.ts
index 07dfe7c476..5a4070a1d4 100644
--- a/packages/backend/src/core/activitypub/models/ApPersonService.ts
+++ b/packages/backend/src/core/activitypub/models/ApPersonService.ts
@@ -296,9 +296,9 @@ export class ApPersonService implements OnModuleInit {
 
 		//#region resolve counts
 		const _resolver = resolver ?? this.apResolverService.createResolver();
-		const outboxcollection = await _resolver.resolveCollection(person.outbox);
-		const followerscollection = await _resolver.resolveCollection(person.followers!);
-		const followingcollection = await _resolver.resolveCollection(person.following!);
+		const outboxcollection = await _resolver.resolveCollection(person.outbox).catch(() => { return null; });
+		const followerscollection = await _resolver.resolveCollection(person.followers!).catch(() => { return null; });
+		const followingcollection = await _resolver.resolveCollection(person.following!).catch(() => { return null; });
 
 		try {
 			// Start transaction
@@ -320,9 +320,9 @@ export class ApPersonService implements OnModuleInit {
 					host,
 					inbox: person.inbox,
 					sharedInbox: person.sharedInbox ?? person.endpoints?.sharedInbox,
-					notesCount: outboxcollection.totalItems ?? 0,
-					followersCount: followerscollection.totalItems ?? 0,
-					followingCount: followingcollection.totalItems ?? 0,
+					notesCount: outboxcollection?.totalItems ?? 0,
+					followersCount: followerscollection?.totalItems ?? 0,
+					followingCount: followingcollection?.totalItems ?? 0,
 					followersUri: person.followers ? getApId(person.followers) : undefined,
 					featured: person.featured ? getApId(person.featured) : undefined,
 					uri: person.id,