Skip to content

Commit

Permalink
fix(@embark/debugger): Prevent error if contract not tracked by Embark
Browse files Browse the repository at this point in the history
Null check to prevent an error during automated debugging for failed transactions.
  • Loading branch information
emizzle authored and iurimatias committed Jan 9, 2020
1 parent 6797a8a commit 1e1172e
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions packages/plugins/debugger/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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; }
Expand Down

0 comments on commit 1e1172e

Please sign in to comment.