diff mod_vjud/vcard.lib.lua @ 806:d15a9eaa63ea

mod_vjud/vcard.lib: Handle empty vcards (thanks mva)
author Kim Alvefur <zash@zash.se>
date Mon, 27 Aug 2012 00:06:06 +0200
parents aeb0999f12fa
children 7dbde05b48a9
line wrap: on
line diff
--- 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 = {};