changeset 3123:f4e86d2662ec

mod_minimix: Handle having received no presence (should not happen)
author Kim Alvefur <zash@zash.se>
date Tue, 19 Jun 2018 22:00:17 +0200
parents c69f32c9c576
children cabe58ae17c9
files mod_minimix/mod_minimix.lua
diffstat 1 files changed, 5 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/mod_minimix/mod_minimix.lua	Tue Jun 19 21:59:34 2018 +0200
+++ b/mod_minimix/mod_minimix.lua	Tue Jun 19 22:00:17 2018 +0200
@@ -32,8 +32,11 @@
 		if data:get(username, room_jid, "subject") then
 			module:log("debug", "Already joined to %s as %s", room_jid, nickname);
 			local presences = data:get(username, room_jid, "presence");
-			for _, pres in pairs(presences) do
-				origin.send(st.clone(pres));
+			if presences then
+				-- Joined but no presence? Weird
+				for _, pres in pairs(presences) do
+					origin.send(st.clone(pres));
+				end
 			end
 			-- FIXME should send ones own presence last
 			local subject = data:get(username, room_jid, "subject");