changeset 4692:37232302dfb9

mod_muc_require_tos: Prevent a traceback when receiving a message with occupant being nil
author Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
date Thu, 16 Sep 2021 22:47:52 +0200
parents 1f1dbf652b37
children 59f53cf66573
files mod_muc_require_tos/mod_muc_require_tos.lua
diffstat 1 files changed, 1 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/mod_muc_require_tos/mod_muc_require_tos.lua	Thu Sep 16 22:32:59 2021 +0200
+++ b/mod_muc_require_tos/mod_muc_require_tos.lua	Thu Sep 16 22:47:52 2021 +0200
@@ -28,7 +28,7 @@
 
 module:hook("muc-occupant-groupchat", function(event)
 	local occupant = event.occupant;
-	if occupant.role ~= "visitor" then
+	if occupant == nil or occupant.role ~= "visitor" then
 		return;
 	end
 	local origin = event.origin;