diff options
| author | Rapptz <[email protected]> | 2021-06-29 23:16:39 -0400 |
|---|---|---|
| committer | Rapptz <[email protected]> | 2021-06-29 23:16:39 -0400 |
| commit | ea1d4239040d24d0a4658b61c1b9326d868746c8 (patch) | |
| tree | a5d4613dab5112e9ee2b335fb0d9d614661dc94d /discord | |
| parent | Rework User.edit to have proper typing (diff) | |
| download | discord.py-ea1d4239040d24d0a4658b61c1b9326d868746c8.tar.xz discord.py-ea1d4239040d24d0a4658b61c1b9326d868746c8.zip | |
Check for None in VocalGuildChannel.voice_states
Diffstat (limited to 'discord')
| -rw-r--r-- | discord/channel.py | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/discord/channel.py b/discord/channel.py index f07ba638..1dddecaa 100644 --- a/discord/channel.py +++ b/discord/channel.py @@ -820,7 +820,13 @@ class VocalGuildChannel(discord.abc.Connectable, discord.abc.GuildChannel, Hasha Mapping[:class:`int`, :class:`VoiceState`] The mapping of member ID to a voice state. """ - return {key: value for key, value in self.guild._voice_states.items() if value.channel.id == self.id} + # fmt: off + return { + key: value + for key, value in self.guild._voice_states.items() + if value.channel and value.channel.id == self.id + } + # fmt: on @utils.copy_doc(discord.abc.GuildChannel.permissions_for) def permissions_for(self, obj: Union[Member, Role], /) -> Permissions: |