Commit 4687dfbb9732a6e1a435066d248e6a2907052cb4

Authored by YunaiV
1 parent ad0d9d10

【功能修复】工作流:新建的流程,部分数据的 NPE 问题

yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/convert/definition/BpmModelConvert.java
@@ -21,6 +21,7 @@ import org.flowable.engine.repository.ProcessDefinition; @@ -21,6 +21,7 @@ import org.flowable.engine.repository.ProcessDefinition;
21 import org.mapstruct.Mapper; 21 import org.mapstruct.Mapper;
22 import org.mapstruct.factory.Mappers; 22 import org.mapstruct.factory.Mappers;
23 23
  24 +import java.util.Collections;
24 import java.util.List; 25 import java.util.List;
25 import java.util.Map; 26 import java.util.Map;
26 27
@@ -101,7 +102,17 @@ public interface BpmModelConvert { @@ -101,7 +102,17 @@ public interface BpmModelConvert {
101 } 102 }
102 103
103 default BpmModelMetaInfoVO parseMetaInfo(Model model) { 104 default BpmModelMetaInfoVO parseMetaInfo(Model model) {
104 - return JsonUtils.parseObject(model.getMetaInfo(), BpmModelMetaInfoVO.class); 105 + BpmModelMetaInfoVO vo = JsonUtils.parseObject(model.getMetaInfo(), BpmModelMetaInfoVO.class);
  106 + if (vo == null) {
  107 + return null;
  108 + }
  109 + if (vo.getManagerUserIds() == null) {
  110 + vo.setManagerUserIds(Collections.emptyList());
  111 + }
  112 + if (vo.getStartUserIds() == null) {
  113 + vo.setStartUserIds(Collections.emptyList());
  114 + }
  115 + return vo;
105 } 116 }
106 117
107 } 118 }