aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBadlop <badlop@process-one.net>2015-03-25 13:56:04 +0100
committerBadlop <badlop@process-one.net>2015-03-26 14:00:58 +0100
commitfbb6b65192ca103aedbd8ee803d7fa2c6d634354 (patch)
tree9c7a8d61b2ab2626a1d02a1ff3bfa69f0a02d9b5
parentFix return error when requesting non-existing vcard value (#21) (diff)
Detect correctly when vCard does not exist (#21)
-rw-r--r--src/mod_admin_extra.erl5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/mod_admin_extra.erl b/src/mod_admin_extra.erl
index f04e6a19a..fb8a5df96 100644
--- a/src/mod_admin_extra.erl
+++ b/src/mod_admin_extra.erl
@@ -976,8 +976,9 @@ get_vcard_content(User, Server, Data) ->
JID = jlib:make_jid(User, Server, get_module_resource(Server)),
IQ = #iq{type = get, xmlns = ?NS_VCARD},
IQr = Module:Function(JID, JID, IQ),
- case IQr#iq.sub_el of
- [A1] ->
+ [A1] = IQr#iq.sub_el,
+ case A1#xmlel.children of
+ [_] ->
case get_vcard(Data, A1) of
[false] -> throw(error_no_value_found_in_vcard);
ElemList -> [xml:get_tag_cdata(Elem) || Elem <- ElemList]