From c413053a7b63691ef0ba39492d3f4979e48a7d32 Mon Sep 17 00:00:00 2001 From: Luke Slater Date: Sun, 4 Sep 2011 15:43:51 +0100 Subject: [PATCH] delete if undefined on rmlast --- modules/quotes.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/modules/quotes.js b/modules/quotes.js index 2050ec3..af223ca 100644 --- a/modules/quotes.js +++ b/modules/quotes.js @@ -21,6 +21,9 @@ var quotes = function(dbot) { var last = addStack.pop(); if(last) { quotes[last].pop(); + if(quotes[last] === undefined) { + delete quotes[last]; + } rmAllowed = false; dbot.say(data.channel, 'Last quote removed from ' + last + '.'); } else {