more error handling
This commit is contained in:
parent
b726fa7fb9
commit
256bcba807
|
@ -75,9 +75,9 @@ function advanceQueue(id, channel, subscription, connection) {
|
||||||
} else {
|
} else {
|
||||||
channel.send('no songs left, leaving');
|
channel.send('no songs left, leaving');
|
||||||
console.log('destroyig');
|
console.log('destroyig');
|
||||||
subscription.unsubscribe();
|
if (subscription) subscription.unsubscribe();
|
||||||
delete players[id];
|
if (players[id]) delete players[id];
|
||||||
connection.destroy();
|
if (connection) connection.destroy();
|
||||||
queue[id] = [];
|
queue[id] = [];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Reference in New Issue