aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthew Wild <mwild1@gmail.com>2018-08-17 08:12:58 +0100
committerMatthew Wild <mwild1@gmail.com>2018-08-17 08:12:58 +0100
commit42ca023dec0dc74cbe789dc1218f60e1ca89362d (patch)
tree6804aa39befe73974b452f89bf21ba838e5a7c4f
parent88962f49f430095bb960d6e59bcdd951d95aaace (diff)
downloadprosody-42ca023dec0dc74cbe789dc1218f60e1ca89362d.tar.gz
prosody-42ca023dec0dc74cbe789dc1218f60e1ca89362d.zip
MUC: Fix traceback when failing to restore a room
When a room exists in the DB but cannot be loaded (e.g. due to max_rooms or a pre-restore handler) restore_room()/get_room_from_jid() returns false.
-rw-r--r--plugins/muc/mod_muc.lua3
1 files changed, 3 insertions, 0 deletions
diff --git a/plugins/muc/mod_muc.lua b/plugins/muc/mod_muc.lua
index df10ef76..4438803c 100644
--- a/plugins/muc/mod_muc.lua
+++ b/plugins/muc/mod_muc.lua
@@ -450,6 +450,9 @@ for event_name, method in pairs {
else
return;
end
+ elseif room == false then -- Error loading room
+ origin.send(st.error_reply(stanza, "wait", "resource-constraint"));
+ return true;
end
return room[method](room, origin, stanza);
end, -2)