Skip to content

Commit

Permalink
fix: catch err on parse abi
Browse files Browse the repository at this point in the history
  • Loading branch information
sahar-fehri committed Jun 27, 2024
1 parent 3c1c3b6 commit 88f1388
Showing 1 changed file with 12 additions and 9 deletions.
21 changes: 12 additions & 9 deletions app/scripts/metamask-controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -6381,7 +6381,6 @@ export default class MetamaskController extends EventEmitter {
txReceiptLog.topics[0] === TRANSFER_SINFLE_LOG_TOPIC_HASH;
const isERC721NftTransfer =
txReceiptLog.topics &&
txReceiptLog.topics.length === 2 && // Added this check because TOKEN_TRANSFER_LOG_TOPIC_HASH is the same for ERC20 and ERC721
txReceiptLog.topics[0] === TOKEN_TRANSFER_LOG_TOPIC_HASH;
let isTransferToSelectedAddress;

Expand Down Expand Up @@ -6419,14 +6418,18 @@ export default class MetamaskController extends EventEmitter {
} else {
iface = new Interface(abiERC721);
}
const parsedLog = iface.parseLog({
data: singleLog.data,
topics: singleLog.topics,
});
allNftParsedLog.push({
contract: singleLog.address,
...parsedLog,
});
try {
const parsedLog = iface.parseLog({
data: singleLog.data,
topics: singleLog.topics,
});
allNftParsedLog.push({
contract: singleLog.address,
...parsedLog,
});
} catch (err) {
// ignore
}
}
});
// Filter known nfts and new Nfts
Expand Down

0 comments on commit 88f1388

Please sign in to comment.