diff --git a/src/adhoc.erl b/src/adhoc.erl index df2104980..bf8abf105 100644 --- a/src/adhoc.erl +++ b/src/adhoc.erl @@ -48,10 +48,11 @@ parse_request(#iq{type = Type, ns = NS, payload = SubEl, lang = Lang}) -> Action = exmpp_xml:get_attribute_as_list(SubEl, 'action', ""), XData = find_xdata_el(SubEl), AllEls = exmpp_xml:get_child_elements(SubEl), - if XData -> - Others = lists:delete(XData, AllEls); - true -> - Others = AllEls + case XData of + false -> + Others = AllEls; + _ -> + Others = lists:delete(XData, AllEls) end, #adhoc_request{lang = Lang,