From 1818a29c29290ae51382f123a3d592e8710ac640 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pawe=C5=82=20Chmielowski?= Date: Mon, 22 May 2023 12:48:29 +0200 Subject: [PATCH] Don't crash in mod_shared_roster_ldap:get_member_jid on empty output This based on crash from issue #3614 --- src/mod_shared_roster_ldap.erl | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/mod_shared_roster_ldap.erl b/src/mod_shared_roster_ldap.erl index 7c97ce011..67dcdf4e4 100644 --- a/src/mod_shared_roster_ldap.erl +++ b/src/mod_shared_roster_ldap.erl @@ -395,14 +395,14 @@ get_member_jid(#state{user_jid_attr = UserJIDAttr, user_uid = UIDAttr} = State, [{<<"%u">>, UID}])], [UserJIDAttr]), case Entries of - [] -> - {error, error}; [#eldap_entry{attributes = [{UserJIDAttr, [MemberJID | _]}]} | _] -> try jid:decode(MemberJID) of #jid{luser = U, lserver = S} -> {U, S} catch error:{bad_jid, _} -> {error, Host} - end + end; + _ -> + {error, error} end. extract_members(State, Extractor, AuthChecker, #eldap_entry{attributes = Attrs}, {DescAcc, JIDsAcc}) ->