mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-02 12:05:57 +01:00
fix: #7912
This commit is contained in:
@@ -53,7 +53,7 @@ topicsController.get = async function getTopic(req, res, callback) {
|
||||
postIndex = await topics.getUserBookmark(tid, req.uid);
|
||||
}
|
||||
|
||||
if (utils.isNumber(postIndex) && (postIndex < 1 || postIndex > topicData.postcount)) {
|
||||
if (utils.isNumber(postIndex) && topicData.postcount > 0 && (postIndex < 1 || postIndex > topicData.postcount)) {
|
||||
return helpers.redirect(res, '/topic/' + req.params.topic_id + '/' + req.params.slug + (postIndex > topicData.postcount ? '/' + topicData.postcount : ''));
|
||||
}
|
||||
postIndex = Math.max(1, postIndex);
|
||||
|
||||
Reference in New Issue
Block a user