From 0a3cff334abcb6a9341b1a3d73b8c8baeca5794c Mon Sep 17 00:00:00 2001 From: Kim Alvefur Date: Wed, 7 Mar 2018 16:01:58 +0100 Subject: MUC: Abort module loading if unable to get list of persistent rooms from storage (fixes #1091) --- plugins/muc/mod_muc.lua | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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 -- cgit v1.2.3