diff --git a/mppbridger.js b/mppbridger.js index df47fb1..a0b3eed 100644 --- a/mppbridger.js +++ b/mppbridger.js @@ -127,6 +127,7 @@ global.createMPPbridge = async function createMPPbridge({room, channel, uri}) { }); gClient.prependListener("bye", async msg => { var participant = gClient.ppl[msg.p]; + if (!participant) return; d.send(`\`${participant._id.substr(0,6)}\` ___**${sanitizeName(participant.name)}** left the room.___`); }); @@ -196,4 +197,4 @@ dClient.once("ready", async function () { handleError(error, JSON.stringify(bridge)); } } -}); \ No newline at end of file +});