Skip to content

Node.js based forum software built for the modern web

fix: prevent crash if items is undefined

Barış Soner Uşaklıa80e314169f1
diff --git a/src/activitypub/helpers.js b/src/activitypub/helpers.js
index 6652f12df0..07f433b8f1 100644
--- a/src/activitypub/helpers.js
+++ b/src/activitypub/helpers.js
@@ -370,7 +370,7 @@ Helpers.generateCollection = async ({ set, method, page, perPage, url }) => {
}
const count = await db.sortedSetCard(set);
const pageCount = Math.max(1, Math.ceil(count / perPage));
- let items;
+ let items = [];
let paginate = true;
if (!page && pageCount === 1) {