mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-10-30 10:35:55 +01:00
fix: resolveLocalId to return null values instead of throwing for no resolution
This commit is contained in:
@@ -53,6 +53,12 @@ Notes.getParentChain = async (uid, input) => {
|
||||
|
||||
const chain = new Set();
|
||||
const traverse = async (uid, id) => {
|
||||
// Handle remote reference to local post
|
||||
const { type, id: localId } = await activitypub.helpers.resolveLocalId(id);
|
||||
if (type === 'post' && localId) {
|
||||
return traverse(uid, localId);
|
||||
}
|
||||
|
||||
const exists = await db.exists(`post:${id}`);
|
||||
if (exists) {
|
||||
const postData = await posts.getPostData(id);
|
||||
|
||||
Reference in New Issue
Block a user