Read contract: fix internal server error for method with empty output array

pull/3514/head
Victor Baranov 4 years ago
parent 19c744f102
commit cf659a196a
  1. 1
      CHANGELOG.md
  2. 2
      apps/explorer/lib/explorer/smart_contract/reader.ex

@ -7,6 +7,7 @@
- [#3462](https://github.com/poanetwork/blockscout/pull/3462) - Display price for bridged tokens - [#3462](https://github.com/poanetwork/blockscout/pull/3462) - Display price for bridged tokens
### Fixes ### 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) - [#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 - [#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 - [#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

@ -454,6 +454,8 @@ defmodule Explorer.SmartContract.Reader do
if String.contains?(number_rest, "[]") do if String.contains?(number_rest, "[]") do
values_array = Enum.at(values, index) values_array = Enum.at(values, index)
values_array = if is_list(values_array), do: values_array, else: []
values_array_formatted = values_array_formatted =
Enum.map(values_array, fn value -> Enum.map(values_array, fn value ->
bytes_to_string(value) bytes_to_string(value)

Loading…
Cancel
Save