From b2d03da96db1b9744683a95bdc32f37e278d73ec Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bar=C4=B1=C5=9F=20Soner=20U=C5=9Fakl=C4=B1?= Date: Wed, 12 Jun 2024 16:04:14 -0400 Subject: [PATCH] refactor: dont need exist check, if post doesnt exist getPostData returns null --- src/activitypub/notes.js | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/activitypub/notes.js b/src/activitypub/notes.js index da377b4c53..228bde68d3 100644 --- a/src/activitypub/notes.js +++ b/src/activitypub/notes.js @@ -244,9 +244,8 @@ Notes.getParentChain = async (uid, input) => { return await traverse(uid, localId); } - const exists = await db.exists(`post:${id}`); - if (exists) { - const postData = await posts.getPostData(id); + const postData = await posts.getPostData(id); + if (postData) { chain.add(postData); if (postData.toPid) { await traverse(uid, postData.toPid);