From 00a74ca47ab562ba112b9295e54a9d2577e855e7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sa=C3=BAl=20Ibarra=20Corretg=C3=A9?= Date: Fri, 26 Nov 2021 15:26:02 +0100 Subject: [PATCH] fix(breakout-rooms) fix checking if a user is in a room Breakout rooms are just reserved UUIDs, they need not exist as actual MUCs, until a participant joins. Thus, take this into account when checking if a participant is in a room. --- resources/prosody-plugins/mod_muc_breakout_rooms.lua | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/resources/prosody-plugins/mod_muc_breakout_rooms.lua b/resources/prosody-plugins/mod_muc_breakout_rooms.lua index 7d998ebe95..fa3f0a4b0a 100644 --- a/resources/prosody-plugins/mod_muc_breakout_rooms.lua +++ b/resources/prosody-plugins/mod_muc_breakout_rooms.lua @@ -263,9 +263,11 @@ function on_message(event) -- Check if the participant is in any breakout room. for breakout_room_jid in pairs(room._data.breakout_rooms or {}) do local breakout_room = breakout_rooms_muc_service.get_room_from_jid(breakout_room_jid); - occupant = breakout_room:get_occupant_by_real_jid(from); - if occupant then - break; + if breakout_room then + occupant = breakout_room:get_occupant_by_real_jid(from); + if occupant then + break; + end end end if not occupant then