From e6624e0185f3b1779b152a7ae4ce3e2013c5c87b Mon Sep 17 00:00:00 2001 From: Jeremy Zhang Date: Fri, 28 Jul 2017 05:30:59 +0000 Subject: [PATCH] hotfix if the membr has a role that does not exist somehow --- webapp/titanembeds/blueprints/api/api.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/webapp/titanembeds/blueprints/api/api.py b/webapp/titanembeds/blueprints/api/api.py index 4fe7ea9..04466dd 100644 --- a/webapp/titanembeds/blueprints/api/api.py +++ b/webapp/titanembeds/blueprints/api/api.py @@ -259,7 +259,9 @@ def get_online_discord_users(guild_id, embed): member["color"] = None if apimem: for roleid in reversed(apimem["roles"]): - role = guildroles_filtered[roleid] + role = guildroles_filtered.get(roleid) + if not role: + continue if role["color"] != 0: member["color"] = '{0:02x}'.format(role["color"]) #int to hex if role["hoist"]: