Commit 005d64aae68374674c928dc575578a1fd9ae479f
Merge remote-tracking branch 'origin/master-jdk17' into master-jdk17
Showing
1 changed file
with
4 additions
and
0 deletions
yudao-module-mall/yudao-module-promotion/src/main/java/cn/iocoder/yudao/module/promotion/service/coupon/CouponServiceImpl.java
| @@ -166,6 +166,10 @@ public class CouponServiceImpl implements CouponService { | @@ -166,6 +166,10 @@ public class CouponServiceImpl implements CouponService { | ||
| 166 | public void invalidateCouponsByAdmin(List<Long> giveCouponIds, Long userId) { | 166 | public void invalidateCouponsByAdmin(List<Long> giveCouponIds, Long userId) { |
| 167 | // 循环收回 | 167 | // 循环收回 |
| 168 | for (Long couponId : giveCouponIds) { | 168 | for (Long couponId : giveCouponIds) { |
| 169 | + // couponId为空或0则跳过 | ||
| 170 | + if (null == couponId || couponId <= 0) { | ||
| 171 | + continue; | ||
| 172 | + } | ||
| 169 | try { | 173 | try { |
| 170 | getSelf().invalidateCoupon(couponId, userId); | 174 | getSelf().invalidateCoupon(couponId, userId); |
| 171 | } catch (Exception e) { | 175 | } catch (Exception e) { |