mirror of
https://github.com/danbulant/discord.js
synced 2026-05-27 14:02:02 +00:00
voice: resolve issue where dispatcher tried to send packets to null socket (#2317)
This commit is contained in:
parent
835bff74cd
commit
8289b70e2c
1 changed files with 4 additions and 1 deletions
|
|
@ -242,10 +242,13 @@ class StreamDispatcher extends Writable {
|
|||
*/
|
||||
this._setSpeaking(true);
|
||||
while (repeats--) {
|
||||
if (!this.player.voiceConnection.sockets.udp) {
|
||||
this.emit('debug', 'Failed to send a packet - no UDP socket');
|
||||
}
|
||||
this.player.voiceConnection.sockets.udp.send(packet)
|
||||
.catch(e => {
|
||||
this._setSpeaking(false);
|
||||
this.emit('debug', `Failed to send a packet ${e}`);
|
||||
this.emit('debug', `Failed to send a packet - ${e}`);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue