delete if undefined on rmlast

This commit is contained in:
Luke Slater 2011-09-04 15:43:51 +01:00
parent 033aac8240
commit c413053a7b

View File

@ -21,6 +21,9 @@ var quotes = function(dbot) {
var last = addStack.pop(); var last = addStack.pop();
if(last) { if(last) {
quotes[last].pop(); quotes[last].pop();
if(quotes[last] === undefined) {
delete quotes[last];
}
rmAllowed = false; rmAllowed = false;
dbot.say(data.channel, 'Last quote removed from ' + last + '.'); dbot.say(data.channel, 'Last quote removed from ' + last + '.');
} else { } else {