From 8afb0255c14a2131ebe5a3fc5785790edea1dc7d Mon Sep 17 00:00:00 2001 From: yflory Date: Mon, 10 Feb 2020 13:27:07 +0100 Subject: [PATCH] Fix team creation --- lib/historyKeeper.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/historyKeeper.js b/lib/historyKeeper.js index ff7b531e9..7a10d9f42 100644 --- a/lib/historyKeeper.js +++ b/lib/historyKeeper.js @@ -908,13 +908,13 @@ module.exports.create = function (cfg, cb) { } // unauthenticated RPC calls have a different message format - if (msg[0] === "WRITE_PRIVATE_MESSAGE" && output && output.channel) { + if (msg[0] === "WRITE_PRIVATE_MESSAGE" && Array.isArray(output) && output[1] && output[1].channel) { // clients don't validate messages sent by the historyKeeper // so this broadcast needs to come from a different id // we pass 'null' to indicate that it's not coming from a real user // to ensure that they know not to trust this message - Server.getChannelUserList(output.channel).forEach(function (userId) { - Server.send(userId, output.message); + Server.getChannelUserList(output[1].channel).forEach(function (userId) { + Server.send(userId, output[1].message); }); // rpc and anonRpc expect their responses to be of a certain length