From ea1d4239040d24d0a4658b61c1b9326d868746c8 Mon Sep 17 00:00:00 2001 From: Rapptz Date: Tue, 29 Jun 2021 23:16:39 -0400 Subject: [PATCH] Check for None in VocalGuildChannel.voice_states --- discord/channel.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/discord/channel.py b/discord/channel.py index f07ba6381..1dddecaa0 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: