Changeset

311:de6e59e751eb

util.vcard: Handle empty vcards
author Kim Alvefur <zash@zash.se>
date Mon, 27 Aug 2012 00:04:30 +0200
parents 310:c3e2b95b5b0b
children 312:f374daa3db4d
files util/vcard.lua
diffstat 1 files changed, 2 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/util/vcard.lua	Thu Aug 09 20:18:55 2012 +0200
+++ b/util/vcard.lua	Mon Aug 27 00:04:30 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 = {};