fix(@embark/debugger): Prevent error if contract not tracked by Embark

Null check to prevent an error during automated debugging for failed transactions.
This commit is contained in:
emizzle 2020-01-06 14:41:45 +11:00 committed by Iuri Matias
parent 6797a8a9fc
commit 1e1172e86c
1 changed files with 1 additions and 0 deletions

View File

@ -48,6 +48,7 @@ export default class TransactionDebugger {
private listenToEvents() {
this.embark.events.on('blockchain:tx', (tx: any) => {
this.embark.events.request('contracts:contract', tx.name, (contract: any) => {
if (!(contract && contract.filename)) { return; }
this.txTracker[tx.transactionHash] = {tx, contract};
this.lastTx = tx.transactionHash;
if (tx.status !== '0x0') { return; }