]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - server/models/activitypub/actor-follow.ts
Fix AP collections pagination
[github/Chocobozzz/PeerTube.git] / server / models / activitypub / actor-follow.ts
index 3373355efff67f0aa8f852d78a8ab00249e82ed3..0a693508354549ff3fbd46d55a9014211535cdb1 100644 (file)
@@ -509,12 +509,12 @@ export class ActorFollowModel extends Model<ActorFollowModel> {
       tasks.push(ActorFollowModel.sequelize.query(query, options))
     }
 
-    const [ followers, [ { total } ] ] = await Promise.all(tasks)
+    const [ followers, [ dataTotal ] ] = await Promise.all(tasks)
     const urls: string[] = followers.map(f => f.url)
 
     return {
       data: urls,
-      total: parseInt(total, 10)
+      total: dataTotal ? parseInt(dataTotal.total, 10) : 0
     }
   }