From b516f8af3a6acde5ab65989358acbec3b7c3c48e Mon Sep 17 00:00:00 2001 From: Jeremy Zhang Date: Fri, 16 Feb 2018 19:46:04 +0000 Subject: [PATCH] return empty list if user guilds are empty --- webapp/titanembeds/oauth.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/webapp/titanembeds/oauth.py b/webapp/titanembeds/oauth.py index 4115a78..22defb1 100644 --- a/webapp/titanembeds/oauth.py +++ b/webapp/titanembeds/oauth.py @@ -59,7 +59,10 @@ def get_user_guilds(): return req def get_user_managed_servers(): - guilds = json.loads(get_user_guilds()) + fetched = get_user_guilds() + if not fetched: + return [] + guilds = json.loads(fetched) filtered = [] for guild in guilds: permission = guild['permissions'] # Manage Server, Ban Members, Kick Members