Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Token instance: check if external_url is not null before trimming #3295

Merged
merged 2 commits into from
Sep 16, 2020

Conversation

vbaranov
Copy link
Member

@vbaranov vbaranov commented Sep 15, 2020

Motivation

Eliminate error like this

Request: GET /tokens/0x7D37700d88D5258e6Ca100D2694dD87A49101412/instance/3/token-transfers
** (exit) an exception was raised:
    ** (FunctionClauseError) no function clause matching in String.Break.trim_leading/1
        (elixir 1.10.3) lib/elixir/unicode/properties.ex:298: String.Break.trim_leading(nil)
        (elixir 1.10.3) lib/string.ex:1177: String.trim/1
        (block_scout_web 0.0.1) lib/block_scout_web/views/tokens/instance/overview_view.ex:51: BlockScoutWeb.Tokens.Instance.OverviewView.external_url/1
        (block_scout_web 0.0.1) lib/block_scout_web/templates/tokens/instance/overview/_details.html.eex:66: BlockScoutWeb.Tokens.Instance.OverviewView."_details.html"/1
        (block_scout_web 0.0.1) lib/block_scout_web/templates/tokens/instance/transfer/index.html.eex:2: BlockScoutWeb.Tokens.Instance.TransferView."index.html"/1
        (phoenix 1.5.4) lib/phoenix/view.ex:310: Phoenix.View.render_within/3
        (phoenix 1.5.4) lib/phoenix/view.ex:472: Phoenix.View.render_to_iodata/3
        (phoenix 1.5.4) lib/phoenix/controller.ex:776: Phoenix.Controller.render_and_send/4

Changelog

Check if external_url is nil in metadata before trimming

Checklist for your Pull Request (PR)

@coveralls
Copy link

coveralls commented Sep 15, 2020

Pull Request Test Coverage Report for Build 2f3eb5d93feb825fa20ad988e9d94f215bf12073-PR-3295

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+3.2%) to 75.836%

Totals Coverage Status
Change from base Build 7be4f27d101f38ecffe8bfecf015887f8644b07d: 3.2%
Covered Lines: 1927
Relevant Lines: 2541

💛 - Coveralls

@vbaranov vbaranov merged commit a3282e8 into master Sep 16, 2020
@vbaranov vbaranov deleted the vb-token-instance-page-fix branch September 16, 2020 05:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants