From 041022db63462e3852aced7ebb49a5f74929bd24 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bar=C4=B1=C5=9F=20Soner=20U=C5=9Fakl=C4=B1?= Date: Sat, 22 Oct 2016 10:41:45 +0300 Subject: [PATCH] #5145 dont crash if res.locals.config is undefined --- src/middleware/header.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/middleware/header.js b/src/middleware/header.js index 2741a599f8..5ad07d25dd 100644 --- a/src/middleware/header.js +++ b/src/middleware/header.js @@ -117,7 +117,7 @@ module.exports = function (middleware) { results.user['email:confirmed'] = parseInt(results.user['email:confirmed'], 10) === 1; results.user.isEmailConfirmSent = !!results.isEmailConfirmSent; - if (parseInt(meta.config.disableCustomUserSkins, 10) !== 1 && res.locals.config.bootswatchSkin !== 'default') { + if (res.locals.config && parseInt(meta.config.disableCustomUserSkins, 10) !== 1 && res.locals.config.bootswatchSkin !== 'default') { templateValues.bootswatchCSS = '//maxcdn.bootstrapcdn.com/bootswatch/latest/' + res.locals.config.bootswatchSkin + '/bootstrap.min.css'; }