Skip to content

Commit 64e19b8

Browse files
committed
Check for None when iterating through permissions
1 parent 7e80e0d commit 64e19b8

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

discord/bot.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,7 @@ async def register_commands(self) -> None:
211211
self.application_commands[i["id"]] = cmd
212212

213213
# Permissions
214-
permissions = [perm.to_dict() for perm in cmd.permissions if perm.guild_id is None or (
214+
permissions = [] if cmd.permissions is None else [perm.to_dict() for perm in cmd.permissions if perm.guild_id is None or (
215215
perm.guild_id == guild_id and perm.guild_id in cmd.guild_ids)]
216216
guild_permissions.append({"id": i["id"], "permissions": permissions})
217217

0 commit comments

Comments
 (0)