Skip to content

Commit

Permalink
fix: handle missing extra field during page render
Browse files Browse the repository at this point in the history
  • Loading branch information
NGPixel committed Oct 3, 2020
1 parent 9762bdc commit 0fa5b97
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions server/controllers/common.js
Original file line number Diff line number Diff line change
Expand Up @@ -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}`
}
Expand Down

0 comments on commit 0fa5b97

Please sign in to comment.