MUC: Abort module loading if unable to get list of persistent rooms from storage (fixes #1091)
authorKim Alvefur <zash@zash.se>
Wed, 07 Mar 2018 16:01:58 +0100
changeset 8705 7e7aa0f770c7
parent 8593 4b5a00fffb22
child 8706 416b8ae3857d
MUC: Abort module loading if unable to get list of persistent rooms from storage (fixes #1091)
plugins/muc/mod_muc.lua
--- a/plugins/muc/mod_muc.lua	Sat Mar 10 20:49:52 2018 +0100
+++ b/plugins/muc/mod_muc.lua	Wed Mar 07 16:01:58 2018 +0100
@@ -37,7 +37,11 @@
 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