mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-16 19:43:29 +01:00
Voice state update null check
This commit is contained in:
@@ -2114,7 +2114,7 @@ var InternalClient = (function () {
|
|||||||
client.emit("warn", "voice state update but user or server not in cache");
|
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.
|
// only for detecting self user movements for connections.
|
||||||
var connection = self.voiceConnections.get("server", server);
|
var connection = self.voiceConnections.get("server", server);
|
||||||
// existing connection, perhaps channel moved
|
// existing connection, perhaps channel moved
|
||||||
|
|||||||
@@ -1824,7 +1824,7 @@ export default class InternalClient {
|
|||||||
client.emit("warn", "voice state update but user or server not in cache");
|
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);
|
var connection = self.voiceConnections.get("server", server);
|
||||||
// existing connection, perhaps channel moved
|
// existing connection, perhaps channel moved
|
||||||
if (connection && connection.voiceChannel.id !== data.channel_id) {
|
if (connection && connection.voiceChannel.id !== data.channel_id) {
|
||||||
|
|||||||
Reference in New Issue
Block a user