From 26ff0279d08bc5d4cb13a2f71e314b05d544da89 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Thu, 22 Aug 2019 14:52:41 +0200 Subject: Fix lazy static route with unknown avatars --- server/controllers/lazy-static.ts | 2 ++ 1 file changed, 2 insertions(+) (limited to 'server') diff --git a/server/controllers/lazy-static.ts b/server/controllers/lazy-static.ts index 28d2f862a..1ff99e90c 100644 --- a/server/controllers/lazy-static.ts +++ b/server/controllers/lazy-static.ts @@ -44,6 +44,8 @@ async function getAvatar (req: express.Request, res: express.Response) { } const avatar = await AvatarModel.loadByName(filename) + if (!avatar) return res.sendStatus(404) + if (avatar.onDisk === false) { if (!avatar.fileUrl) return res.sendStatus(404) -- cgit v1.2.3