aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRapptz <[email protected]>2017-05-22 22:28:19 -0400
committerRapptz <[email protected]>2017-05-22 22:28:19 -0400
commit5a56e3fda158201a0bbf27c16f6b3995af9d8813 (patch)
tree153d740a78c043462c581ace2dd8e7146271ff2a
parentAdd ref links to the commands API page. (diff)
downloaddiscord.py-5a56e3fda158201a0bbf27c16f6b3995af9d8813.tar.xz
discord.py-5a56e3fda158201a0bbf27c16f6b3995af9d8813.zip
Don't dispatch on_voice_state_update when Member is not found.
-rw-r--r--discord/state.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/discord/state.py b/discord/state.py
index 1871055f..9487371d 100644
--- a/discord/state.py
+++ b/discord/state.py
@@ -721,8 +721,10 @@ class ConnectionState:
voice.channel = ch
member, before, after = guild._update_voice_state(data, channel_id)
- if after is not None:
+ if member is not None:
self.dispatch('voice_state_update', member, before, after)
+ else:
+ log.warning('VOICE_STATE_UPDATE referencing an unknown member ID: %s. Discarding.', data['user_id'])
else:
# in here we're either at private or group calls
call = self._calls.get(channel_id)