Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Fix 'badarg' in io_lib:format/2 when 'from' field is tuple
  • Loading branch information
tigercl authored and turtleDeng committed Nov 9, 2018
1 parent 997958a commit c76e2d1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/emqx_message.erl
Expand Up @@ -114,7 +114,7 @@ elapsed(Since) ->
max(0, timer:now_diff(os:timestamp(), Since) div 1000).

format(#message{id = Id, qos = QoS, topic = Topic, from = From, flags = Flags, headers = Headers}) ->
io_lib:format("Message(Id=~s, QoS=~w, Topic=~s, From=~s, Flags=~s, Headers=~s)",
io_lib:format("Message(Id=~s, QoS=~w, Topic=~s, From=~p, Flags=~s, Headers=~s)",
[Id, QoS, Topic, From, format(flags, Flags), format(headers, Headers)]).

format(_, undefined) ->
Expand Down

0 comments on commit c76e2d1

Please sign in to comment.