# HG changeset patch # User Kim Alvefur # Date 1520887659 -3600 # Node ID 0e84814a7eceada49b78a38dd1a33f04655727d5 # Parent ba6a6a04b46c0d08bd8ac30144d81fddf0a8140c MUC: Produce an untracked, locked room on failure to read room from storage (#1091) diff -r ba6a6a04b46c -r 0e84814a7ece plugins/muc/mod_muc.lua --- a/plugins/muc/mod_muc.lua Thu Mar 22 16:26:09 2018 +0000 +++ b/plugins/muc/mod_muc.lua Mon Mar 12 21:47:39 2018 +0100 @@ -148,13 +148,17 @@ 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