Changeset

12188:0fee75871f78

mod_storage_xep0227: be defensive against empty vCard An empty vCard store may look like the empty table, which does not have the `attr` key, which would then blow up in util.stanza.deserialize.
author Jonas Schäfer <jonas@wielicki.name>
date Sat, 15 Jan 2022 15:39:13 +0100
parents 12187:94253e02d47d
children 12189:82c8e855c850
files plugins/mod_storage_xep0227.lua
diffstat 1 files changed, 1 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/plugins/mod_storage_xep0227.lua	Sat Jan 15 15:13:41 2022 +0100
+++ b/plugins/mod_storage_xep0227.lua	Sat Jan 15 15:39:13 2022 +0100
@@ -160,7 +160,7 @@
 		local usere = xml and getUserElement(xml);
 		if usere then
 			usere:remove_children("vCard", "vcard-temp");
-			if not data then
+			if not data or not data.attr then
 				-- No data to set, old one deleted, success
 				return true;
 			end