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

Merge pull request #2025 from ErisDS/issue-2000

Start up safely when the activeTheme is not present
This commit is contained in:
Hannah Wolfe 2014-01-25 13:06:41 -08:00
commit 951385ec2d

View file

@ -142,13 +142,18 @@ function manageAdminAndTheme(req, res, next) {
if (!config.paths().availableThemes.hasOwnProperty(activeTheme.value)) {
if (!res.isAdmin) {
// Throw an error if the theme is not available, but not on the admin UI
errors.logAndThrowError('The currently active theme ' + activeTheme.value + ' is missing.');
return errors.throwError('The currently active theme ' + activeTheme.value + ' is missing.');
}
} else {
activateTheme(activeTheme.value);
}
}
next();
}).otherwise(function (err) {
// Trying to start up without the active theme present, setup a simple hbs instance
// and render an error page straight away.
expressServer.engine('hbs', hbs.express3());
next(err);
});
}