From a0554183c57f86388ed05c162dedeed33ba61a71 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micka=C3=ABl=20R=C3=A9mond?= Date: Sat, 9 Jan 2010 16:18:59 +0000 Subject: [PATCH] Attempt to fix dialyzer warning: adhoc.erl:51: Guard test XData::'false' | #xmlel{ns::'jabber:x:data',declared_ns::[{_,_}],attrs::[{_,_,_,_}],children::'undefined' | [{_,_} | {_,_,_,_,_,_}]} =:= 'true' can never succeed SVN Revision: 2869 --- src/adhoc.erl | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) 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,