From d0f2029fa68285f8d77d135e4c9ea8611fd821f4 Mon Sep 17 00:00:00 2001 From: abalabahaha Date: Fri, 15 Apr 2016 18:15:20 -0700 Subject: [PATCH] Voice state update null check --- lib/Client/InternalClient.js | 2 +- src/Client/InternalClient.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/Client/InternalClient.js b/lib/Client/InternalClient.js index f94ead20b..97f730b5c 100644 --- a/lib/Client/InternalClient.js +++ b/lib/Client/InternalClient.js @@ -2114,7 +2114,7 @@ var InternalClient = (function () { client.emit("warn", "voice state update but user or server not in cache"); } - if (user.id === self.user.id) { + if (user && user.id === self.user.id) { // only for detecting self user movements for connections. var connection = self.voiceConnections.get("server", server); // existing connection, perhaps channel moved diff --git a/src/Client/InternalClient.js b/src/Client/InternalClient.js index 66494995b..eba59b10a 100644 --- a/src/Client/InternalClient.js +++ b/src/Client/InternalClient.js @@ -1824,7 +1824,7 @@ export default class InternalClient { client.emit("warn", "voice state update but user or server not in cache"); } - if (user.id === self.user.id) { // only for detecting self user movements for connections. + if (user && user.id === self.user.id) { // only for detecting self user movements for connections. var connection = self.voiceConnections.get("server", server); // existing connection, perhaps channel moved if (connection && connection.voiceChannel.id !== data.channel_id) {