aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/controllers/lazy-static.ts
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2019-08-22 14:52:41 +0200
committerChocobozzz <me@florianbigard.com>2019-08-22 14:52:41 +0200
commit26ff0279d08bc5d4cb13a2f71e314b05d544da89 (patch)
treebe53d69fe1855010e5c64861c71503efc4c1b5da /server/controllers/lazy-static.ts
parent820546916cad3ae4cc51eab408aef7bbaff3632f (diff)
downloadPeerTube-26ff0279d08bc5d4cb13a2f71e314b05d544da89.tar.gz
PeerTube-26ff0279d08bc5d4cb13a2f71e314b05d544da89.tar.zst
PeerTube-26ff0279d08bc5d4cb13a2f71e314b05d544da89.zip
Fix lazy static route with unknown avatars
Diffstat (limited to 'server/controllers/lazy-static.ts')
-rw-r--r--server/controllers/lazy-static.ts2
1 files changed, 2 insertions, 0 deletions
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) {
44 } 44 }
45 45
46 const avatar = await AvatarModel.loadByName(filename) 46 const avatar = await AvatarModel.loadByName(filename)
47 if (!avatar) return res.sendStatus(404)
48
47 if (avatar.onDisk === false) { 49 if (avatar.onDisk === false) {
48 if (!avatar.fileUrl) return res.sendStatus(404) 50 if (!avatar.fileUrl) return res.sendStatus(404)
49 51