Skip to content

Node.js based forum software built for the modern web

math.ceil pageCount

Baris Usaklib9b02a1fabd2
diff --git a/src/controllers/accounts/notifications.js b/src/controllers/accounts/notifications.js
index 9e1839b42b..c6715ba144 100644
--- a/src/controllers/accounts/notifications.js
+++ b/src/controllers/accounts/notifications.js
@@ -70,7 +70,7 @@ notificationsController.get = function (req, res, next) {
user.notifications.getAll(req.uid, selectedFilter.filter, _next);
},
function (nids, next) {
- pageCount = nids.length / itemsPerPage;
+ pageCount = Math.max(1, Math.ceil(nids.length / itemsPerPage));
nids = nids.slice(start, stop + 1);
user.notifications.getNotifications(nids, req.uid, next);