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