Skip to content

Node.js based forum software built for the modern web

refactor: prolly dont need exists check

Barış Soner Uşaklıa42c9a6bec04
diff --git a/src/topics/posts.js b/src/topics/posts.js
index 7a87b2cdc6..f7e37f100f 100644
--- a/src/topics/posts.js
+++ b/src/topics/posts.js
@@ -281,8 +281,7 @@ module.exports = function (Topics) {
Topics.getTopicField(tid, 'mainPid'),
db.getSortedSetRange(`tid:${tid}:posts`, 0, -1),
]);
- const mainPidExists = await posts.exists(mainPid);
- if (mainPidExists) {
+ if (mainPid) {
pids = [mainPid].concat(pids);
}
return pids;