From bf650297a1f67cf43374b7fb81502c774f99fbd0 Mon Sep 17 00:00:00 2001
From: Rapptz <rapptz@gmail.com>
Date: Fri, 20 May 2016 19:22:22 -0400
Subject: [PATCH] Only trigger on_voice_state_update if the member actually
 exists.

---
 discord/state.py | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/discord/state.py b/discord/state.py
index b28529db5..7c1ba9937 100644
--- a/discord/state.py
+++ b/discord/state.py
@@ -521,8 +521,9 @@ class ConnectionState:
                 if voice is not None:
                     voice.channel = server.get_channel(data.get('channel_id'))
 
-            updated_members = server._update_voice_state(data)
-            self.dispatch('voice_state_update', *updated_members)
+            before, after = server._update_voice_state(data)
+            if after is not None:
+                self.dispatch('voice_state_update', before, after)
 
     def parse_typing_start(self, data):
         channel = self.get_channel(data.get('channel_id'))