Handle invalid ABI retrieved from address_book gracefully (#4606)

* Handle invalid ABI gracefully

* Also include failed abi in log
This commit is contained in:
Jaco Greeff 2017-02-20 13:34:33 +01:00 committed by GitHub
parent e86837b878
commit 3fc29b9ae4
1 changed files with 12 additions and 2 deletions

View File

@ -54,9 +54,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;
}