From: Chocobozzz Date: Thu, 22 Aug 2019 12:52:41 +0000 (+0200) Subject: Fix lazy static route with unknown avatars X-Git-Tag: v1.4.0~9 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=26ff0279d08bc5d4cb13a2f71e314b05d544da89;p=oweals%2Fpeertube.git Fix lazy static route with unknown avatars --- 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)