Handle invalid ABI retrieved from address_book gracefully (#4606) (#4610)

* Handle invalid ABI gracefully

* Also include failed abi in log
This commit is contained in:
Jaco Greeff 2017-02-20 13:48:23 +01:00 committed by Arkadiy Paronyan
parent b5219bc723
commit 7df702494d
1 changed files with 12 additions and 2 deletions

View File

@ -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;
}