aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2018-03-07 16:01:58 +0100
committerKim Alvefur <zash@zash.se>2018-03-07 16:01:58 +0100
commit0a3cff334abcb6a9341b1a3d73b8c8baeca5794c (patch)
tree201a8c06eca4d684a223149de3a05759c0a3163c
parent4e8f44b8f75c597e95ce5ac743393fdb3e72dd71 (diff)
downloadprosody-0a3cff334abcb6a9341b1a3d73b8c8baeca5794c.tar.gz
prosody-0a3cff334abcb6a9341b1a3d73b8c8baeca5794c.zip
MUC: Abort module loading if unable to get list of persistent rooms from storage (fixes #1091)
-rw-r--r--plugins/muc/mod_muc.lua6
1 files changed, 5 insertions, 1 deletions
diff --git a/plugins/muc/mod_muc.lua b/plugins/muc/mod_muc.lua
index 8c223cb2..bccd8915 100644
--- a/plugins/muc/mod_muc.lua
+++ b/plugins/muc/mod_muc.lua
@@ -37,7 +37,11 @@ local hosts = prosody.hosts;
rooms = {};
local rooms = rooms;
local persistent_rooms_storage = module:open_store("persistent");
-local persistent_rooms = persistent_rooms_storage:get() or {};
+local persistent_rooms, err = persistent_rooms_storage:get();
+if not persistent_rooms then
+ assert(not err, err);
+ persistent_rooms = {};
+end
local room_configs = module:open_store("config");
-- Configurable options