mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-14 18:43:31 +01:00
voice: properly null-check udp socket first (#2317)
This commit is contained in:
@@ -242,6 +242,7 @@ class StreamDispatcher extends Writable {
|
|||||||
while (repeats--) {
|
while (repeats--) {
|
||||||
if (!this.player.voiceConnection.sockets.udp) {
|
if (!this.player.voiceConnection.sockets.udp) {
|
||||||
this.emit('debug', 'Failed to send a packet - no UDP socket');
|
this.emit('debug', 'Failed to send a packet - no UDP socket');
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
this.player.voiceConnection.sockets.udp.send(packet)
|
this.player.voiceConnection.sockets.udp.send(packet)
|
||||||
.catch(e => {
|
.catch(e => {
|
||||||
|
|||||||
Reference in New Issue
Block a user