Fix a KeyError for channels with no category in Guild.by_category

This commit is contained in:
Rapptz 2020-06-27 05:27:47 -04:00
parent c01bf7cd56
commit f94b00cb48

View File

@ -412,7 +412,10 @@ class Guild(Hashable):
grouped[channel.id] = []
continue
grouped[channel.category_id].append(channel)
try:
grouped[channel.category_id].append(channel)
except KeyError:
grouped[channel.category_id] = [channel]
def key(t):
k, v = t