From e6205e8f264570454d7c77be730fe5ac490bb1a9 Mon Sep 17 00:00:00 2001 From: Badlop Date: Mon, 27 Jul 2009 09:37:24 +0000 Subject: [PATCH] Fix error when nick registration stanza doesn't contain Value. SVN Revision: 2395 --- src/mod_muc/mod_muc.erl | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/mod_muc/mod_muc.erl b/src/mod_muc/mod_muc.erl index 593fc5143..d8de5af3b 100644 --- a/src/mod_muc/mod_muc.erl +++ b/src/mod_muc/mod_muc.erl @@ -756,14 +756,14 @@ process_iq_register_set(Host, From, SubEl, Lang) -> {error, 'bad-request'}; _ -> case lists:keysearch("nick", 1, XData) of - false -> + {value, {_, [Nick]}} -> + iq_set_register_info(Host, From, list_to_binary(Nick), Lang); + _ -> ErrText = "You must fill in field \"Nickname\" in the form", Err = exmpp_stanza:error(SubEl#xmlel.ns, 'not-acceptable', {Lang, translate:translate(Lang,ErrText)}), - {error, Err}; - {value, {_, [Nick]}} -> - iq_set_register_info(Host, From, list_to_binary(Nick), Lang) + {error, Err} end end; _ ->