Skip to content
This repository has been archived by the owner on Nov 6, 2020. It is now read-only.

Commit

Permalink
Handle invalid ABI retrieved from address_book gracefully (#4606) (#4610
Browse files Browse the repository at this point in the history
)

* Handle invalid ABI gracefully

* Also include failed abi in log
  • Loading branch information
jacogr authored and arkpar committed Feb 20, 2017
1 parent b5219bc commit 7df7024
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions js/src/ui/MethodDecoding/methodDecodingStore.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,19 @@ export default class MethodDecodingStore {
}

loadFromAbi (_abi, contractAddress) {
const abi = new Abi(_abi);
let abi;

if (contractAddress && abi) {
try {
abi = new Abi(_abi);
} catch (error) {
console.warn('loadFromAbi', error, _abi);
}

if (!abi) {
return;
}

if (contractAddress) {
this._contractsAbi[contractAddress] = abi;
}

Expand Down

0 comments on commit 7df7024

Please sign in to comment.