Skip to content

Commit

Permalink
🐛 handle missing escrow for app in UpdateSidechainHandler
Browse files Browse the repository at this point in the history
  • Loading branch information
Theezr committed Nov 11, 2024
1 parent 8ebe68a commit 7b7a7d9
Showing 1 changed file with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,10 @@ export class UpdateSidechainHandler implements ICommandHandler<UpdateSidechainCo
const escrowForApp = amounts.escrowedAmounts.escrowedAmounts.find(
(escrow) => escrow.escrowChainID === app.chainID,
);
if (!escrowForApp) {
this.logger.error('no escrowForApp found.');
return;
}

await this.prisma.blockchainApp.update({
where: { chainName: name },
Expand All @@ -55,8 +59,8 @@ export class UpdateSidechainHandler implements ICommandHandler<UpdateSidechainCo
escrow: {
deleteMany: {},
create: {
tokenID: escrowForApp.tokenID,
amount: escrowForApp.amount,
tokenID: escrowForApp.tokenID ?? '0',
amount: escrowForApp.amount ?? '0',
},
},
},
Expand Down

0 comments on commit 7b7a7d9

Please sign in to comment.