From 21d6f305c76d88a91c8a5cbdfbc5ca8af72d2b76 Mon Sep 17 00:00:00 2001 From: syuilo Date: Sat, 21 Jan 2017 13:20:32 +0900 Subject: [PATCH] [Server] Fix bug --- src/web/server.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/web/server.ts b/src/web/server.ts index 9c44807f9..a1b7130ba 100644 --- a/src/web/server.ts +++ b/src/web/server.ts @@ -29,7 +29,7 @@ app.use(compression()); app.use((req, res, next) => { res.header('X-Frame-Options', 'DENY'); - res.locals.user = (req.headers['cookie'].match(/i=(!\w+)/) || [null, null])[1]; + res.locals.user = ((req.headers['cookie'] || '').match(/i=(!\w+)/) || [null, null])[1]; next(); });