From 28740de766f5178802400700b4db6f793371c642 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bar=C4=B1=C5=9F=20Soner=20U=C5=9Fakl=C4=B1?= Date: Fri, 12 May 2023 09:40:39 -0400 Subject: [PATCH] fix: #11595, use default value --- src/controllers/admin/settings.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/controllers/admin/settings.js b/src/controllers/admin/settings.js index 3255680a1e..e0b3e9b6da 100644 --- a/src/controllers/admin/settings.js +++ b/src/controllers/admin/settings.js @@ -111,7 +111,7 @@ settingsController.social = async function (req, res) { }; settingsController.api = async (req, res) => { - const { tokens } = await meta.settings.get('core.api'); + const { tokens = [] } = await meta.settings.get('core.api'); const scores = await api.utils.getLastSeen(tokens.map(t => t.token)); const [lastSeen, lastSeenISO] = tokens.reduce((memo, cur, idx) => {