瀏覽代碼

!1181 【缺陷修复】退款回收优惠券错误
Merge pull request !1181 from 壁虎在家/master-jdk17

芋道源码 7 月之前
父節點
當前提交
0e9827e5a0

+ 3 - 0
yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/service/coupon/CouponServiceImpl.java

@@ -178,6 +178,9 @@ public class CouponServiceImpl implements CouponService {
      */
     @Transactional(rollbackFor = Exception.class)
     public void invalidateCoupon(Long couponId, Long userId) {
+        if (couponId == null || couponId <= 0) {
+            return;
+        }
         // 1.1 校验优惠券
         CouponDO coupon = couponMapper.selectByIdAndUserId(couponId, userId);
         if (coupon == null) {