mirror of
				https://github.com/NodeBB/NodeBB.git
				synced 2025-10-31 02:55:58 +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 | ||||
| 			const outbox = actor.outbox ? await activitypub.get('uid', 0, actor.outbox) : { totalItems: 0 }; | ||||
| 			actor.postcount = outbox.totalItems; | ||||
| 			try { | ||||
| 				const outbox = actor.outbox ? await activitypub.get('uid', 0, actor.outbox) : { totalItems: 0 }; | ||||
| 				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 | ||||
| 			if (actor.hasOwnProperty('followers') && activitypub.helpers.isUri(actor.followers)) { | ||||
|   | ||||
		Reference in New Issue
	
	Block a user