fix: handle missing extra field during page render

pull/2543/head
NGPixel 4 years ago
parent 9762bdc2ce
commit 0fa5b9750d

@ -493,6 +493,9 @@ router.get('/*', async (req, res, next) => {
body: WIKI.config.theming.injectBody body: WIKI.config.theming.injectBody
} }
// Handle missing extra field
page.extra = page.extra || { css: '', js: '' }
if (!_.isEmpty(page.extra.css)) { if (!_.isEmpty(page.extra.css)) {
injectCode.css = `${injectCode.css}\n${page.extra.css}` injectCode.css = `${injectCode.css}\n${page.extra.css}`
} }

Loading…
Cancel
Save