From c33be64b79ff83dd5fa50d70e9456caf518c6838 Mon Sep 17 00:00:00 2001 From: Luna Mendes Date: Tue, 20 Nov 2018 13:42:00 -0300 Subject: [PATCH] invites: return 404 on unknown inv --- litecord/blueprints/invites.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/litecord/blueprints/invites.py b/litecord/blueprints/invites.py index a2f8963..cb2898c 100644 --- a/litecord/blueprints/invites.py +++ b/litecord/blueprints/invites.py @@ -51,6 +51,9 @@ async def create_invite(channel_id): async def get_invite(invite_code: str): inv = await app.storage.get_invite(invite_code) + if not inv: + return '', 404 + if request.args.get('with_counts'): extra = await app.storage.get_invite_extra(invite_code) inv.update(extra)