Skip to content

Commit

Permalink
fix: null referance exception
Browse files Browse the repository at this point in the history
  • Loading branch information
MichaelTaylor3D committed Sep 7, 2022
1 parent 89bd204 commit cc52370
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/controllers/offer.controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,10 @@ export const cancelActiveOffer = async (req, res) => {
where: { metaKey: 'activeOfferTradeId' },
});

await datalayer.cancelOffer(activeOffer.metaValue);
if (activeOffer) {
await datalayer.cancelOffer(activeOffer.metaValue);
}

await Promise.all([
Meta.destroy({ where: { metaKey: 'activeOfferTradeId' } }),
Staging.destroy({ where: { isTransfer: true } }),
Expand Down

0 comments on commit cc52370

Please sign in to comment.