From a80e314169f1a4a9af1e501ff3fcd571483c0569 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bar=C4=B1=C5=9F=20Soner=20U=C5=9Fakl=C4=B1?= Date: Mon, 9 Sep 2024 14:04:11 -0400 Subject: [PATCH] fix: prevent crash if items is undefined --- src/activitypub/helpers.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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) {