check if address_id is binary in token_transfers_csv endpoint

pull/2422/head
Ayrat Badykov 5 years ago
parent 79e6650cb7
commit 433cec0d36
No known key found for this signature in database
GPG Key ID: B44668E265E9396F
  1. 2
      apps/block_scout_web/lib/block_scout_web/controllers/address_transaction_controller.ex

@ -110,7 +110,7 @@ defmodule BlockScoutWeb.AddressTransactionController do
end end
end end
def token_transfers_csv(conn, %{"address_id" => address_hash_string}) do def token_transfers_csv(conn, %{"address_id" => address_hash_string}) when is_binary(address_hash_string) do
with {:ok, address_hash} <- Chain.string_to_address_hash(address_hash_string), with {:ok, address_hash} <- Chain.string_to_address_hash(address_hash_string),
{:ok, address} <- Chain.hash_to_address(address_hash) do {:ok, address} <- Chain.hash_to_address(address_hash) do
address address

Loading…
Cancel
Save