Skip to content

Commit

Permalink
Applying a modified patch from Chris Laux fixing a bug in the twitter…
Browse files Browse the repository at this point in the history
…_client:text_or_default/3 function.
  • Loading branch information
ngerakines committed Jun 22, 2008
1 parent 7c6066f commit 2c58866
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions twitter_client.erl
Expand Up @@ -610,7 +610,11 @@ parse_user(Body) when is_list(Body) ->
%% @private
text_or_default(_, [], Default) -> Default;
text_or_default(Xml, [Xpath | Tail], Default) ->
case xmerl_xpath:string(Xpath, Xml) of
[ #xmlText{value = Val} ] -> Val;
_ -> text_or_default(Xml, Tail, Default)
end.
Res = lists:foldr(
fun(#xmlText{value = Val}, Acc) -> lists:append(Val, Acc);
(_, Acc) -> Acc
end,
Default,
xmerl_xpath:string(Xpath, Xml)
),
text_or_default(Xml, Tail, Res).

0 comments on commit 2c58866

Please sign in to comment.