Update saveRadios function

This commit is contained in:
Christer Warén 2021-09-14 17:13:37 +03:00
parent a43a788e15
commit 24478b6320

View File

@ -4,9 +4,10 @@ module.exports = function saveRadios(client) {
while (!radio.done) {
let currentRadio = client.radio.get(radio.value);
currentRadio.guild = client.datastore.getEntry(radio.value).guild;
if (currentRadio) {
currentRadio.guild = client.datastore.getEntry(radio.value).guild;
client.funcs.statisticsUpdate(client, currentRadio.guild, currentRadio);
client.funcs.saveState(client, currentRadio.guild, currentRadio);
currentRadio.connection?.destroy();