Fix lazy static route with unknown avatars

pull/2073/head
Chocobozzz 2019-08-22 14:52:41 +02:00
parent 820546916c
commit 26ff0279d0
No known key found for this signature in database
GPG Key ID: 583A612D890159BE
1 changed files with 2 additions and 0 deletions

View File

@ -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)