0
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2025-01-20 22:42:53 -05:00

🐛 Fixed admin error page on startup

closes #10616

- The check should be on empty object because that's the default state of expresses 'engines' property - 3ed5090ca9/lib/application.js (L59)
- The bug was introduced with 5e963935f9 (diff-04cc23b216e11161ab7267d69f13d004R142)
This commit is contained in:
Nazar Gargol 2019-04-01 15:02:21 +08:00
parent 0d89acd910
commit b9eaf27e56

View file

@ -168,7 +168,7 @@ _private.ThemeErrorRenderer = (err, req, res, next) => {
// It can be that something went wrong with the theme or otherwise loading handlebars
// This ensures that no matter what res.render will work here
// @TODO: split the error handler for assets, admin & theme to refactor this away
if (!req.app.engines || Object.keys(req.app.engines).length === 0) {
if (_.isEmpty(req.app.engines)) {
res._template = 'error';
req.app.engine('hbs', _private.createHbsEngine());
req.app.set('view engine', 'hbs');
@ -201,7 +201,7 @@ _private.HTMLErrorRenderer = (err, req, res, next) => { // eslint-disable-line n
// e.g. if you serve the admin /ghost and Ghost returns a 503 because it generates the urls at the moment.
// This ensures that no matter what res.render will work here
// @TODO: put to prepare error function?
if (!req.app.engines || req.app.engines.length === 0) {
if (_.isEmpty(req.app.engines)) {
res._template = 'error';
req.app.engine('hbs', _private.createHbsEngine());
req.app.set('view engine', 'hbs');