Changeset

1215:1b55d8f86644

mod_blocking: Make sure that there is a lists item in the privacy store
author Kim Alvefur <zash@zash.se>
date Mon, 28 Oct 2013 11:10:02 +0100
parents 1214:a234ad611633
children 1216:81a3bf8aba90
files mod_blocking/mod_blocking.lua
diffstat 1 files changed, 3 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/mod_blocking/mod_blocking.lua	Thu Oct 24 11:52:58 2013 -0400
+++ b/mod_blocking/mod_blocking.lua	Mon Oct 28 11:10:02 2013 +0100
@@ -9,6 +9,9 @@
 function add_blocked_jid(username, host, jid)
 	local privacy_lists = datamanager.load(username, host, "privacy") or {lists = {}};
 	local default_list_name = privacy_lists.default;
+	if not privacy_lists.lists then
+		privacy_lists.lists = {}
+	end
 	if not default_list_name then
 		default_list_name = "blocklist";
 		privacy_lists.default = default_list_name;