From 0fa5b9750db001f25bc9034a47b93c4a3846cae8 Mon Sep 17 00:00:00 2001 From: NGPixel Date: Sat, 3 Oct 2020 16:50:51 -0400 Subject: [PATCH] fix: handle missing extra field during page render --- server/controllers/common.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/server/controllers/common.js b/server/controllers/common.js index bf67b519..03b931ef 100644 --- a/server/controllers/common.js +++ b/server/controllers/common.js @@ -493,6 +493,9 @@ router.get('/*', async (req, res, next) => { body: WIKI.config.theming.injectBody } + // Handle missing extra field + page.extra = page.extra || { css: '', js: '' } + if (!_.isEmpty(page.extra.css)) { injectCode.css = `${injectCode.css}\n${page.extra.css}` }