mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-02 03:55:55 +01:00
fix: getParentChain error handling
This commit is contained in:
@@ -107,22 +107,22 @@ Notes.getParentChain = async (uid, input) => {
|
|||||||
let object;
|
let object;
|
||||||
try {
|
try {
|
||||||
object = await activitypub.get('uid', uid, id);
|
object = await activitypub.get('uid', uid, id);
|
||||||
|
|
||||||
|
// Handle incorrect id passed in
|
||||||
|
if (id !== object.id) {
|
||||||
|
return await traverse(uid, object.id);
|
||||||
|
}
|
||||||
|
|
||||||
|
object = await activitypub.mocks.post(object);
|
||||||
|
if (object) {
|
||||||
|
chain.add(object);
|
||||||
|
if (object.toPid) {
|
||||||
|
await traverse(uid, object.toPid);
|
||||||
|
}
|
||||||
|
}
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
winston.warn(`[activitypub/notes/getParentChain] Cannot retrieve ${id}, terminating here.`);
|
winston.warn(`[activitypub/notes/getParentChain] Cannot retrieve ${id}, terminating here.`);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Handle incorrect id passed in
|
|
||||||
if (id !== object.id) {
|
|
||||||
return await traverse(uid, object.id);
|
|
||||||
}
|
|
||||||
|
|
||||||
object = await activitypub.mocks.post(object);
|
|
||||||
if (object) {
|
|
||||||
chain.add(object);
|
|
||||||
if (object.toPid) {
|
|
||||||
await traverse(uid, object.toPid);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user