Prevent uncaught exceptions when uncaching from library

This commit is contained in:
calzoneman 2013-08-07 13:27:17 -04:00
parent bc24e8d9dc
commit c6d49cfef0
1 changed files with 4 additions and 1 deletions

View File

@ -1323,7 +1323,10 @@ Channel.prototype.tryUncache = function(user, data) {
return;
}
if(this.server.db.removeFromLibrary(this.name, data.id)) {
this.logger.log("*** " + user.name + " deleted " + this.library[data.id].title + " from library");
var msg = data.id;
if(data.id in this.library)
msg = this.library[data.id];
this.logger.log("*** " + user.name + " deleted " + msg + " from library");
delete this.library[data.id];
}
}