Skip to content

Commit

Permalink
fix crash when decoding kv responses when response value is not binary
Browse files Browse the repository at this point in the history
  • Loading branch information
reset committed Jan 19, 2015
1 parent 5286242 commit 15bd2e4
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/consul/handler/kv.ex
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ defmodule Consul.Handler.Kv do
defp decode_body(items) when is_list(items) do
Enum.map(items, &decode_body/1)
end
defp decode_body(%{"Value" => value} = item) do
defp decode_body(%{"Value" => value} = item) when is_binary(value) do
%{item | "Value" => :base64.decode(value)}
end
defp decode_body(item), do: item
Expand Down

0 comments on commit 15bd2e4

Please sign in to comment.