voice: null-check UDP socket

This commit is contained in:
Amish Shah 2018-07-03 14:15:27 +01:00
parent 695ff1e70f
commit d81441f627
No known key found for this signature in database
GPG key ID: 904349C1207D7967

View file

@ -143,7 +143,7 @@ class StreamDispatcher extends VolumeInterface {
* @param {string} info The debug info
*/
this.setSpeaking(true);
while (repeats--) {
while (repeats-- && this.player.voiceConnection.sockets.udp) {
this.player.voiceConnection.sockets.udp.send(packet)
.catch(e => {
this.setSpeaking(false);