mod_vjud/vcard.lib: Handle empty vcards (thanks mva)
authorKim Alvefur <zash@zash.se>
Mon, 27 Aug 2012 00:06:06 +0200
changeset 806 d15a9eaa63ea
parent 805 7e474c7f450a
child 807 7d1d3ca31d03
mod_vjud/vcard.lib: Handle empty vcards (thanks mva)
mod_vjud/vcard.lib.lua
--- a/mod_vjud/vcard.lib.lua	Sun Aug 26 17:20:45 2012 +0000
+++ b/mod_vjud/vcard.lib.lua	Mon Aug 27 00:06:06 2012 +0200
@@ -98,7 +98,7 @@
 end
 
 function to_xep54(vCards)
-	if vCards[1].name then
+	if not vCards[1] or vCards[1].name then
 		return vcard_to_xep54(vCards)
 	else
 		local t = st.stanza("xCard", { xmlns = "vcard-temp" });
@@ -213,7 +213,7 @@
 end
 
 function to_text(vCards)
-	if vCards[1].name then
+	if vCards[1] and vCards[1].name then
 		return vcard_to_text(vCards)
 	else
 		local t = {};