Skip to content

Commit

Permalink
Fix undefined error
Browse files Browse the repository at this point in the history
  • Loading branch information
thesantatitan committed Nov 10, 2021
1 parent 0e43991 commit 238ee5d
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/routes/payment.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,12 @@ route.post(
}
}
});
if (!product || product.seller.user.banned || product.seller.user.deleted || product.banned) {
if (!product) {
respond(res, req, 404, ERROR.PRODUCT_NOT_FOUND);
return;
}

if(product && product.seller.user.banned || product.seller.user.deleted || product.banned){
respond(res, req, 404, ERROR.PRODUCT_NOT_FOUND);
return;
}
Expand Down

0 comments on commit 238ee5d

Please sign in to comment.