Changeset

8702:7e7aa0f770c7

MUC: Abort module loading if unable to get list of persistent rooms from storage (fixes #1091)
author Kim Alvefur <zash@zash.se>
date Wed, 07 Mar 2018 16:01:58 +0100
parents 8590:4b5a00fffb22
children 8703:416b8ae3857d
files plugins/muc/mod_muc.lua
diffstat 1 files changed, 5 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- 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