From d81441f627efef83a7d3bd125ee2f46c118ccfc9 Mon Sep 17 00:00:00 2001 From: Amish Shah Date: Tue, 3 Jul 2018 14:15:27 +0100 Subject: [PATCH] voice: null-check UDP socket --- src/client/voice/dispatcher/StreamDispatcher.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/client/voice/dispatcher/StreamDispatcher.js b/src/client/voice/dispatcher/StreamDispatcher.js index 1064f3243..77734caa3 100644 --- a/src/client/voice/dispatcher/StreamDispatcher.js +++ b/src/client/voice/dispatcher/StreamDispatcher.js @@ -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);