diff --git a/db/boards.js b/db/boards.js index a3579b6a..2ac932a6 100644 --- a/db/boards.js +++ b/db/boards.js @@ -298,7 +298,12 @@ module.exports = { } ]) .toArray() - .then(res => res[0].sites.sort((a, b) => a.localeCompare(b))); + .then(res => { + if (res[0].sites) { + return res[0].sites.sort((a, b) => a.localeCompare(b)); + } + return []; + }); cache.set('webringsites', webringSites); } return webringSites; diff --git a/views/pages/home.pug b/views/pages/home.pug index fa467277..5af2a82c 100644 --- a/views/pages/home.pug +++ b/views/pages/home.pug @@ -51,13 +51,13 @@ block content .table-container.flex-center.mv-10.text-center table(style='max-width:450px') tr - th Overall Stats + th Local Stats tr td pre.no-m-p | There are currently #[span.bold #{localStats.total-localStats.unlisted}] public boards, #[span.bold #{localStats.total}] in total. Sitewide, #[span.bold #{localStats.ppd}] post#{localStats.ppd === 1 ? ' has' : 's have'} been made in the last day, #[span.bold #{localStats.pph}] in the last hour, #[span.bold #{localStats.posts}] in total. | #[span.bold #{fileStats.count}] file#{fileStats.count === 1 ? ' is' : 's are'} being served, totaling #[span.bold #{fileStats.totalSizeString}]. - if enableWebring === true + if enableWebring === true && webringStats != null .table-container.flex-center.mv-10.text-center table(style='max-width:450px') tr