Skip to content

Node.js based forum software built for the modern web

post_index fix

barisusaklif9c9f5856162
diff --git a/src/controllers/topics.js b/src/controllers/topics.js
index bfc2b4e396..6e72f3a446 100644
--- a/src/controllers/topics.js
+++ b/src/controllers/topics.js
@@ -62,9 +62,10 @@ topicsController.get = function(req, res, next) {
}
var postIndex = 0;
+ req.params.post_index = req.params.post_index || 0;
if (!settings.usePagination) {
if (reverse) {
- if (!req.params.post_index || parseInt(req.params.post_index, 10) === 1) {
+ if (parseInt(req.params.post_index, 10) === 1) {
req.params.post_index = 0;
}
postIndex = Math.max(postCount - (req.params.post_index || postCount) - (settings.postsPerPage - 1), 0);