mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-10-26 16:46:12 +01:00
refactor: dont need exist check, if post doesnt exist getPostData returns null
This commit is contained in:
@@ -244,9 +244,8 @@ Notes.getParentChain = async (uid, input) => {
|
|||||||
return await traverse(uid, localId);
|
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);
|
chain.add(postData);
|
||||||
if (postData.toPid) {
|
if (postData.toPid) {
|
||||||
await traverse(uid, postData.toPid);
|
await traverse(uid, postData.toPid);
|
||||||
|
|||||||
Reference in New Issue
Block a user