voice: properly null-check udp socket first (#2317)

This commit is contained in:
Amish Shah
2018-03-13 09:48:18 +00:00
parent 513dbf2f68
commit ef8366d189

View File

@@ -242,6 +242,7 @@ class StreamDispatcher extends Writable {
while (repeats--) {
if (!this.player.voiceConnection.sockets.udp) {
this.emit('debug', 'Failed to send a packet - no UDP socket');
return;
}
this.player.voiceConnection.sockets.udp.send(packet)
.catch(e => {