mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-10-30 02:25:55 +01:00
fix: prevent crash if items is undefined
This commit is contained in:
@@ -370,7 +370,7 @@ Helpers.generateCollection = async ({ set, method, page, perPage, url }) => {
|
|||||||
}
|
}
|
||||||
const count = await db.sortedSetCard(set);
|
const count = await db.sortedSetCard(set);
|
||||||
const pageCount = Math.max(1, Math.ceil(count / perPage));
|
const pageCount = Math.max(1, Math.ceil(count / perPage));
|
||||||
let items;
|
let items = [];
|
||||||
let paginate = true;
|
let paginate = true;
|
||||||
|
|
||||||
if (!page && pageCount === 1) {
|
if (!page && pageCount === 1) {
|
||||||
|
|||||||
Reference in New Issue
Block a user