From 2feebf3e6afaad9ab80976d1557d3a7bcf94de03 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Wed, 5 Dec 2018 17:27:24 +0100 Subject: Add sitemap --- server/helpers/express-utils.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'server/helpers') diff --git a/server/helpers/express-utils.ts b/server/helpers/express-utils.ts index 162fe2244..9a72ee96d 100644 --- a/server/helpers/express-utils.ts +++ b/server/helpers/express-utils.ts @@ -7,12 +7,12 @@ import { extname } from 'path' import { isArray } from './custom-validators/misc' import { UserModel } from '../models/account/user' -function buildNSFWFilter (res: express.Response, paramNSFW?: string) { +function buildNSFWFilter (res?: express.Response, paramNSFW?: string) { if (paramNSFW === 'true') return true if (paramNSFW === 'false') return false if (paramNSFW === 'both') return undefined - if (res.locals.oauth) { + if (res && res.locals.oauth) { const user: UserModel = res.locals.oauth.token.User // User does not want NSFW videos -- cgit v1.2.3