Commit 7e2e9592a7a0ddf969da0e10b33731279b3c5d68
1 parent
50adebd1
fix(crm):回款操作日志取计划期数补判空——计划已删除时 getReceivablePeriod 不再 NPE,挂已删计划的回款可正常删除/更新
Showing
1 changed file
with
2 additions
and
1 deletions
yudao-module-crm/src/main/java/cn/iocoder/yudao/module/crm/service/receivable/CrmReceivableServiceImpl.java
| @@ -190,7 +190,8 @@ public class CrmReceivableServiceImpl implements CrmReceivableService { | @@ -190,7 +190,8 @@ public class CrmReceivableServiceImpl implements CrmReceivableService { | ||
| 190 | return null; | 190 | return null; |
| 191 | } | 191 | } |
| 192 | CrmReceivablePlanDO receivablePlan = receivablePlanService.getReceivablePlan(planId); | 192 | CrmReceivablePlanDO receivablePlan = receivablePlanService.getReceivablePlan(planId); |
| 193 | - return receivablePlan.getPeriod(); | 193 | + // 计划已被删除时查询返回 null:期数返回 null,避免 NPE 导致删除/更新回款失败 |
| 194 | + return receivablePlan == null ? null : receivablePlan.getPeriod(); | ||
| 194 | } | 195 | } |
| 195 | 196 | ||
| 196 | @Override | 197 | @Override |