From 3c283a52e0788e48862a07ba588daec04a4f6196 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christer=20War=C3=A9n?= Date: Mon, 3 Aug 2020 13:02:52 +0300 Subject: [PATCH] Fixing #11 --- client/events/voiceStateUpdate.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/client/events/voiceStateUpdate.js b/client/events/voiceStateUpdate.js index 366ae1f..f35ee6a 100644 --- a/client/events/voiceStateUpdate.js +++ b/client/events/voiceStateUpdate.js @@ -32,7 +32,7 @@ module.exports = { } if (oldState.channel.members.size === 1 && oldState.channel === radio.voiceChannel || change) { setTimeout(() => { - if (!radio) return; + if (!radio || !radio.connection.dispatcher || !radio.connection.dispatcher === null) return; if (radio.voiceChannel.members.size === 1) { client.funcs.statisticsUpdate(client, newState.guild, radio); radio.connection.dispatcher.destroy(); @@ -42,4 +42,4 @@ module.exports = { }, 120000); } } -}; \ No newline at end of file +};