summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorlassulus <lassulus@googlemail.com>2014-03-17 01:51:26 +0100
committerlassulus <lassulus@googlemail.com>2014-03-17 01:51:26 +0100
commite8292ba803596a2605d0ff8a94f51eb8707c115a (patch)
treeb5aa71189de8b4009c883aa372713f98ad8dac72
parente653d6c832f8fce5937fb782286fd5856e21b204 (diff)
newsbot.js: only delete real slaves
-rw-r--r--news/newsbot.js7
1 files changed, 4 insertions, 3 deletions
diff --git a/news/newsbot.js b/news/newsbot.js
index 499f595a..55564f0f 100644
--- a/news/newsbot.js
+++ b/news/newsbot.js
@@ -228,10 +228,11 @@ methods.add = function (params, callback) {
}
}
methods.del = function (params, callback) {
- var slave = slaves[params[0]]
- if (slave) {
+ var nick = params[0]
+ if (slaves.hasOwnProperty(nick)) {
+ var slave = slaves[nick]
slave.client.disconnect()
- delete slaves[params[0]]
+ delete slaves[nick]
return callback(null)
} else {
return callback(new Error('botname not found'))