From bb100ed33ec5dfe46eccc3ac0a89e6d7f9952ac3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jonas=20Sch=C3=A4fer?= Date: Sat, 15 Jan 2022 15:39:13 +0100 Subject: 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. --- plugins/mod_storage_xep0227.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'plugins') diff --git a/plugins/mod_storage_xep0227.lua b/plugins/mod_storage_xep0227.lua index 1676341b..3cd783bc 100644 --- a/plugins/mod_storage_xep0227.lua +++ b/plugins/mod_storage_xep0227.lua @@ -160,7 +160,7 @@ handlers.vcard = { 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 -- cgit v1.2.3