From 0adc77bb0d1e716971ca1d362412a98a7ba819e0 Mon Sep 17 00:00:00 2001 From: Kim Alvefur Date: Mon, 12 Mar 2018 21:47:39 +0100 Subject: MUC: Produce an untracked, locked room on failure to read room from storage (#1091) --- plugins/muc/mod_muc.lua | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'plugins') diff --git a/plugins/muc/mod_muc.lua b/plugins/muc/mod_muc.lua index 83ed4900..bd739315 100644 --- a/plugins/muc/mod_muc.lua +++ b/plugins/muc/mod_muc.lua @@ -148,13 +148,17 @@ end local function restore_room(jid) local node = jid_split(jid); - local data = room_configs:get(node); + local data, err = room_configs:get(node); local state = room_state:get(node); if data then module:log("debug", "Restoring room %s from storage", jid); local room = muclib.restore_room(data, state); track_room(room); return room; + elseif err then + module:log("error", "Error restoring room %s from storage: %s", jid, err); + local room = muclib.new_room(jid, { locked = math.huge }); + return room; end end -- cgit v1.2.3