Commit a4649e158c500330cfd43004e8bc47076414c808
Committed by
GitHub
Merge pull request #1280 from dadiyang/fix/crm-receivable-plan-npe-on-delete
[BUG] CRM 回款:挂在回款计划下的回款永远删不掉——计划已删时删除必报系统异常,计划未删时又被拒绝(——操作日志取计划期数未判空)
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 |