mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-10-31 19:15:58 +01:00
default for missing post_index parameter
Avoid getting NaN if post_index param is not set (NaN is passed through to redis, redis complains, and the user ends up at /404)
This commit is contained in:
@@ -72,7 +72,7 @@ topicsController.get = function(req, res, next) {
|
||||
postIndex = Math.max((req.params.post_index || 1) - (settings.postsPerPage + 1), 0);
|
||||
}
|
||||
} else if (!req.query.page) {
|
||||
var index = Math.max(parseInt(req.params.post_index, 10), 0);
|
||||
var index = Math.max(parseInt(req.params.post_index, 10), 0) || 0;
|
||||
page = Math.ceil((index + 1) / settings.postsPerPage);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user