aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/lib/activitypub/actors
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2022-07-15 11:18:29 +0200
committerChocobozzz <me@florianbigard.com>2022-07-15 11:18:29 +0200
commit654d4ede7fa4d0faa71e49bcfab6b65a686397b2 (patch)
treeaf3eb4c4338c5c12cda9a35f03be81d7a82066e1 /server/lib/activitypub/actors
parent319f9670bfd07f19862de565c7cc936ba7f6fda9 (diff)
downloadPeerTube-654d4ede7fa4d0faa71e49bcfab6b65a686397b2.tar.gz
PeerTube-654d4ede7fa4d0faa71e49bcfab6b65a686397b2.tar.zst
PeerTube-654d4ede7fa4d0faa71e49bcfab6b65a686397b2.zip
Correctly handle actors without follow counters
Diffstat (limited to 'server/lib/activitypub/actors')
-rw-r--r--server/lib/activitypub/actors/shared/url-to-object.ts7
1 files changed, 5 insertions, 2 deletions
diff --git a/server/lib/activitypub/actors/shared/url-to-object.ts b/server/lib/activitypub/actors/shared/url-to-object.ts
index 12a121725..208d108ee 100644
--- a/server/lib/activitypub/actors/shared/url-to-object.ts
+++ b/server/lib/activitypub/actors/shared/url-to-object.ts
@@ -27,8 +27,11 @@ async function fetchRemoteActor (actorUrl: string): Promise<{ statusCode: number
27} 27}
28 28
29async function fetchActorFollowsCount (actorObject: ActivityPubActor) { 29async function fetchActorFollowsCount (actorObject: ActivityPubActor) {
30 const followersCount = await fetchActorTotalItems(actorObject.followers) 30 let followersCount = 0
31 const followingCount = await fetchActorTotalItems(actorObject.following) 31 let followingCount = 0
32
33 if (actorObject.followers) followersCount = await fetchActorTotalItems(actorObject.followers)
34 if (actorObject.following) followingCount = await fetchActorTotalItems(actorObject.following)
32 35
33 return { followersCount, followingCount } 36 return { followersCount, followingCount }
34} 37}