From cf659a196aaa82cc198080744b845989fe11beca Mon Sep 17 00:00:00 2001 From: Victor Baranov Date: Mon, 7 Dec 2020 22:22:22 +0300 Subject: [PATCH] Read contract: fix internal server error for method with empty output array --- CHANGELOG.md | 1 + apps/explorer/lib/explorer/smart_contract/reader.ex | 2 ++ 2 files changed, 3 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9b5283092b..cba4a60544 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,7 @@ - [#3462](https://github.com/poanetwork/blockscout/pull/3462) - Display price for bridged tokens ### Fixes +- [#3514](https://github.com/poanetwork/blockscout/pull/3514) - Read contract: fix internal server error - [#3513](https://github.com/poanetwork/blockscout/pull/3513) - Fix input data processing for method call (array type of data) - [#3509](https://github.com/poanetwork/blockscout/pull/3509) - Fix QR code tooltip appearance in mobile view - [#3507](https://github.com/poanetwork/blockscout/pull/3507), [#3510](https://github.com/poanetwork/blockscout/pull/3510) - Fix left margin of balance card in mobile view diff --git a/apps/explorer/lib/explorer/smart_contract/reader.ex b/apps/explorer/lib/explorer/smart_contract/reader.ex index 304bf8cf0f..e51c35e9b5 100644 --- a/apps/explorer/lib/explorer/smart_contract/reader.ex +++ b/apps/explorer/lib/explorer/smart_contract/reader.ex @@ -454,6 +454,8 @@ defmodule Explorer.SmartContract.Reader do if String.contains?(number_rest, "[]") do values_array = Enum.at(values, index) + values_array = if is_list(values_array), do: values_array, else: [] + values_array_formatted = Enum.map(values_array, fn value -> bytes_to_string(value)