# HG changeset patch # User Kim Alvefur # Date 1521091197 -3600 # Node ID a4e63b037a2aae5ba9e7db84683a0f25bf198d17 # Parent 7fc0784491efa2b814d16cc2b5401923639bcd0b MUC: Catch and log error in case of storage failure in iterator over rooms diff -r 7fc0784491ef -r a4e63b037a2a plugins/muc/mod_muc.lua --- a/plugins/muc/mod_muc.lua Thu Mar 22 20:08:32 2018 +0100 +++ b/plugins/muc/mod_muc.lua Thu Mar 15 06:19:57 2018 +0100 @@ -230,7 +230,15 @@ coroutine.yield(room); seen[room.jid] = true; end - for room_jid in pairs(persistent_rooms_storage:get(nil) or {}) do + local all_persistent_rooms, err = persistent_rooms_storage:get(nil); + if not all_persistent_rooms then + if err then + module:log("error", "Error loading list of persistent rooms, only rooms live in memory were iterated over"); + module:log("debug", "%s", debug.traceback(err)); + end + return nil; + end + for room_jid in pairs(all_persistent_rooms) do if not seen[room_jid] then local room = restore_room(room_jid); if room then