mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-10-30 18:46:01 +01:00
fix: handle inaccessible boosts
This commit is contained in:
@@ -122,7 +122,6 @@ Notes.getParentChain = async (uid, input) => {
|
||||
}
|
||||
} catch (e) {
|
||||
winston.warn(`[activitypub/notes/getParentChain] Cannot retrieve ${id}, terminating here.`);
|
||||
chain.delete(id);
|
||||
}
|
||||
}
|
||||
};
|
||||
@@ -153,6 +152,10 @@ Notes.assertTopic = async (uid, id) => {
|
||||
*/
|
||||
|
||||
const chain = Array.from(await Notes.getParentChain(uid, id));
|
||||
if (!chain.length) {
|
||||
return null;
|
||||
}
|
||||
|
||||
let { pid: mainPid, tid, uid: authorId, timestamp, name, content } = chain[chain.length - 1];
|
||||
const members = await db.isSortedSetMembers(`tid:${tid}:posts`, chain.map(p => p.pid));
|
||||
if (tid && members.every(Boolean)) {
|
||||
|
||||
Reference in New Issue
Block a user