From 2277fba4105cea75deee6e99f0fe43aaab68ec39 Mon Sep 17 00:00:00 2001 From: Lamp Date: Wed, 25 Jul 2018 12:06:48 -0700 Subject: [PATCH] fix error on !list when bridge client is not connected --- src/mppbridger/commands/list.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/mppbridger/commands/list.js b/src/mppbridger/commands/list.js index 1de2eb5..1bfbcc2 100644 --- a/src/mppbridger/commands/list.js +++ b/src/mppbridger/commands/list.js @@ -8,6 +8,11 @@ module.exports = { message.reply(`Use this in a bridged room to see who is at the other side.`); return; } + var client = clients[row.site][row.mpp_room]; + if (!client || !client.isConnected()) { + message.reply(`This bridge is not connected.`); + return; + } var ppl = clients[row.site][row.mpp_room].ppl; var numberOfPpl = Object.keys(ppl).length; @@ -20,4 +25,4 @@ module.exports = { str += names.join(', '); message.channel.send(str, {split:{char:''}}); } -}; \ No newline at end of file +};