mirror of
https://github.com/NodeBB/NodeBB.git
synced 2026-02-05 14:20:13 +01:00
fix: #12502, improper decrement
This commit is contained in:
@@ -316,7 +316,7 @@ Topics.search = async function (tid, term) {
|
|||||||
Topics.getPidByIndex = async function (tid, index) {
|
Topics.getPidByIndex = async function (tid, index) {
|
||||||
index -= 2; // zset only stores replies, index is not zero-indexed, so offset by 2.
|
index -= 2; // zset only stores replies, index is not zero-indexed, so offset by 2.
|
||||||
return index > 0 ?
|
return index > 0 ?
|
||||||
(await db.getSortedSetRange(`tid:${tid}:posts`, index - 2, index - 2)).pop() :
|
(await db.getSortedSetRange(`tid:${tid}:posts`, index, index)).pop() :
|
||||||
await Topics.getTopicField(tid, 'mainPid');
|
await Topics.getTopicField(tid, 'mainPid');
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user