diff options
author | lassulus <lassulus@googlemail.com> | 2014-03-17 01:51:26 +0100 |
---|---|---|
committer | lassulus <lassulus@googlemail.com> | 2014-03-17 01:51:26 +0100 |
commit | e8292ba803596a2605d0ff8a94f51eb8707c115a (patch) | |
tree | b5aa71189de8b4009c883aa372713f98ad8dac72 /news/newsbot.js | |
parent | e653d6c832f8fce5937fb782286fd5856e21b204 (diff) |
newsbot.js: only delete real slaves
Diffstat (limited to 'news/newsbot.js')
-rw-r--r-- | news/newsbot.js | 7 |
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')) |