mirror of
https://github.com/danbulant/discord.js
synced 2026-09-18 05:54:20 +00:00
Fix #2018 (rapid joining/leaving of voice channel causes a crash)
This commit is contained in:
parent
356778b9d5
commit
29d743a521
1 changed files with 4 additions and 0 deletions
|
|
@ -103,6 +103,10 @@ class VoiceConnectionUDPClient extends EventEmitter {
|
|||
const socket = this.socket = udp.createSocket('udp4');
|
||||
|
||||
socket.once('message', message => {
|
||||
|
||||
// Stop if the sockets have been deleted because the connection has been closed already
|
||||
if (!this.voiceConnection.sockets.ws) return;
|
||||
|
||||
const packet = parseLocalPacket(message);
|
||||
if (packet.error) {
|
||||
this.emit('error', packet.error);
|
||||
|
|
|
|||
Loading…
Reference in a new issue