Skip to content
This repository was archived by the owner on Feb 15, 2018. It is now read-only.

Commit 0e504d0

Browse files
committed
fix the weird list/binary behavior
1 parent 6a5a2d0 commit 0e504d0

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/autocluster_consul.erl

+6-1
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,12 @@ host_sname(Value) ->
187187
Parts = string:tokens(binary_to_list(Value), "."),
188188
case length(Parts) of
189189
1 -> binary_to_list(Value);
190-
_ -> binary_to_list(lists:nth(1, Parts))
190+
_ ->
191+
SName = lists:nth(1, Parts),
192+
case is_list(SName) of
193+
true -> SName;
194+
false -> binary_to_list(SName)
195+
end
191196
end.
192197

193198

0 commit comments

Comments
 (0)