mod_compat_vcard: Fix traceback from probably empty stanzas (Thanks Biszkopcik)
authorKim Alvefur <zash@zash.se>
Sun, 02 Feb 2014 23:21:10 +0100
changeset 1297 3df303543765
parent 1296 b1a92a87309c
child 1298 659da45a2b4b
mod_compat_vcard: Fix traceback from probably empty stanzas (Thanks Biszkopcik)
mod_compat_vcard/mod_compat_vcard.lua
--- a/mod_compat_vcard/mod_compat_vcard.lua	Sun Feb 02 18:12:42 2014 +0100
+++ b/mod_compat_vcard/mod_compat_vcard.lua	Sun Feb 02 23:21:10 2014 +0100
@@ -10,7 +10,7 @@
 module:hook("iq/full", function(event)
 	local stanza = event.stanza;
 	local payload = stanza.tags[1];
-	if payload.name == "vCard" and stanza.attr.type == "get" and payload.attr.xmlns == "vcard-temp" then
+	if payload and stanza.attr.type == "get" and payload.name == "vCard" and payload.attr.xmlns == "vcard-temp" then
 		local fixed_stanza = st.clone(event.stanza);
 		fixed_stanza.attr.to = jid_bare(stanza.attr.to);
 		core_process_stanza(event.origin, fixed_stanza);