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

TypeError: Cannot read property 'toString' of undefined #10553

Closed
sentry-io bot opened this issue Mar 2, 2021 · 0 comments · Fixed by #10634
Closed

TypeError: Cannot read property 'toString' of undefined #10553

sentry-io bot opened this issue Mar 2, 2021 · 0 comments · Fixed by #10634
Assignees
Labels
Sev2-normal Normal severity; minor loss of service or inconvenience. type-bug

Comments

@sentry-io
Copy link

sentry-io bot commented Mar 2, 2021

Sentry Issue: METAMASK-GN8X

TypeError: Cannot read property 'toString' of undefined
  at bnToHex (app/scripts/lib/util.js:195:31)
  at None (app/scripts/lib/account-tracker.js:289:25)
  at Array.forEach (<anonymous>)
  at callback (app/scripts/lib/account-tracker.js:288:17)
...
(3 additional frame(s) were not displayed)

When using the flaire network as a custom rpc, the results below contains an undefined value for at least one of the users addresses.

const ethContract = this.web3.eth
      .contract(SINGLE_CALL_BALANCES_ABI)
      .at(deployedContractAddress);
    const ethBalance = ['0x0'];

    ethContract.balances(addresses, ethBalance, (error, result) => {

We can likely default the balance to 0 on lines 289 and 290:

        const balance = bnToHex(result[index]);
        accounts[address] = { address, balance };
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Sev2-normal Normal severity; minor loss of service or inconvenience. type-bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants