Changeset

4775:fd90925dc239

mod_muc_offline_delivery: Handle the user not having any affiliation data (thanks Martin)
author Matthew Wild <mwild1@gmail.com>
date Thu, 18 Nov 2021 09:07:40 +0000
parents 4774:1132f2888cd2
children 4776:13e913471b75
files mod_muc_offline_delivery/mod_muc_offline_delivery.lua
diffstat 1 files changed, 1 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/mod_muc_offline_delivery/mod_muc_offline_delivery.lua	Wed Nov 17 13:35:00 2021 +0000
+++ b/mod_muc_offline_delivery/mod_muc_offline_delivery.lua	Thu Nov 18 09:07:40 2021 +0000
@@ -21,7 +21,7 @@
 	local room = event.room;
 	for jid, affiliation, data in room:each_affiliation() do --luacheck: ignore 213/affiliation
 		local reserved_nickname = data and data.reserved_nickname;
-		local user_setting = data.offline_delivery;
+		local user_setting = data and data.offline_delivery or nil;
 		if reserved_nickname and user_setting or (user_setting == nil and default_enable) then
 			local is_absent = not room:get_occupant_by_nick(room.jid.."/"..reserved_nickname);
 			if is_absent then