mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-12-21 07:50:37 +01:00
fix: put postcount retrieval behind try..catch so errors are handled appropriately
This commit is contained in:
@@ -51,8 +51,13 @@ Actors.assert = async (ids, options = {}) => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Post count
|
// Post count
|
||||||
|
try {
|
||||||
const outbox = actor.outbox ? await activitypub.get('uid', 0, actor.outbox) : { totalItems: 0 };
|
const outbox = actor.outbox ? await activitypub.get('uid', 0, actor.outbox) : { totalItems: 0 };
|
||||||
actor.postcount = outbox.totalItems;
|
actor.postcount = outbox.totalItems;
|
||||||
|
} catch (e) {
|
||||||
|
// no action required
|
||||||
|
winston.verbose(`[activitypub/actor.assert] Unable to retrieve post counts for ${actor.id}`);
|
||||||
|
}
|
||||||
|
|
||||||
// Followers url for backreference
|
// Followers url for backreference
|
||||||
if (actor.hasOwnProperty('followers') && activitypub.helpers.isUri(actor.followers)) {
|
if (actor.hasOwnProperty('followers') && activitypub.helpers.isUri(actor.followers)) {
|
||||||
|
|||||||
Reference in New Issue
Block a user