From ef8366d189b8c53f4acdc279caaae9fe682d63f2 Mon Sep 17 00:00:00 2001 From: Amish Shah Date: Tue, 13 Mar 2018 09:48:18 +0000 Subject: [PATCH] voice: properly null-check udp socket first (#2317) --- src/client/voice/dispatcher/StreamDispatcher.js | 1 + 1 file changed, 1 insertion(+) diff --git a/src/client/voice/dispatcher/StreamDispatcher.js b/src/client/voice/dispatcher/StreamDispatcher.js index ed394cf05..79edd60dc 100644 --- a/src/client/voice/dispatcher/StreamDispatcher.js +++ b/src/client/voice/dispatcher/StreamDispatcher.js @@ -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 => {