From d0f15ebaf80387bd58f59e750b0c5cb9ecc66255 Mon Sep 17 00:00:00 2001 From: Brath Date: Mon, 24 Apr 2023 08:04:24 +0000 Subject: [PATCH 1/2] =?UTF-8?q?update=20ruoyi-system/src/main/java/com/ruo?= =?UTF-8?q?yi/workflow/service/impl/WfProcessServiceImpl.java.=20=E5=9C=A8?= =?UTF-8?q?=E7=B3=BB=E7=BB=9F=E6=A8=A1=E5=9D=97=E6=B5=81=E7=A8=8B=E6=9C=8D?= =?UTF-8?q?=E5=8A=A1=E4=B8=AD=E7=9A=84=E5=AE=9E=E7=8E=B0=E7=B1=BB=EF=BC=9A?= =?UTF-8?q?WfProcessServiceImpl=E7=AC=AC767=E8=A1=8C=E5=A2=9E=E5=8A=A0?= =?UTF-8?q?=E4=BA=86=E4=BB=A3=E7=A0=81=EF=BC=9A=20=20if=20(formInfoList.si?= =?UTF-8?q?ze()=20=3D=3D=200)=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20?= =?UTF-8?q?=20=20continue;=20=20=E7=9B=AE=E7=9A=84=E6=98=AF=EF=BC=9A?= =?UTF-8?q?=E9=81=BF=E5=85=8D=E7=A9=BA=E9=9B=86=E5=90=88=E5=AF=BC=E8=87=B4?= =?UTF-8?q?=E7=9A=84NULL=E7=A9=BA=E6=8C=87=E9=92=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Brath --- .../ruoyi/workflow/service/impl/WfProcessServiceImpl.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/ruoyi-system/src/main/java/com/ruoyi/workflow/service/impl/WfProcessServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/workflow/service/impl/WfProcessServiceImpl.java index 03d90eae..e87e237c 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/workflow/service/impl/WfProcessServiceImpl.java +++ b/ruoyi-system/src/main/java/com/ruoyi/workflow/service/impl/WfProcessServiceImpl.java @@ -764,6 +764,11 @@ public class WfProcessServiceImpl extends FlowServiceFactory implements IWfProce .eq(WfDeployForm::getDeployId, historicProcIns.getDeploymentId()) .eq(WfDeployForm::getFormKey, formKey) .eq(localScope, WfDeployForm::getNodeKey, flowElement.getId())); + //@author Brath + //避免空集合导致的NULL空指针 + if (formInfoList.size() == 0) + continue; + WfDeployFormVo formInfo = formInfoList.iterator().next(); if (ObjectUtil.isNotNull(formInfo)) { // 旧数据 formInfo.getFormName() 为 null From db7be5772b30f2fa6cb41e597bbffd78a96e9115 Mon Sep 17 00:00:00 2001 From: Brath Date: Wed, 26 Apr 2023 07:05:02 +0000 Subject: [PATCH 2/2] =?UTF-8?q?update=20ruoyi-system/src/main/java/com/ruo?= =?UTF-8?q?yi/workflow/service/impl/WfProcessServiceImpl.java.=20=E6=8C=89?= =?UTF-8?q?=E7=85=A7=E4=BD=9C=E8=80=85=E7=9A=84=E4=BB=A3=E7=A0=81=E6=96=B9?= =?UTF-8?q?=E5=BC=8F=E9=87=8D=E6=96=B0=E4=BF=AE=E6=94=B9=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Brath --- .../ruoyi/workflow/service/impl/WfProcessServiceImpl.java | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/ruoyi-system/src/main/java/com/ruoyi/workflow/service/impl/WfProcessServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/workflow/service/impl/WfProcessServiceImpl.java index e87e237c..56d97e29 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/workflow/service/impl/WfProcessServiceImpl.java +++ b/ruoyi-system/src/main/java/com/ruoyi/workflow/service/impl/WfProcessServiceImpl.java @@ -764,12 +764,10 @@ public class WfProcessServiceImpl extends FlowServiceFactory implements IWfProce .eq(WfDeployForm::getDeployId, historicProcIns.getDeploymentId()) .eq(WfDeployForm::getFormKey, formKey) .eq(localScope, WfDeployForm::getNodeKey, flowElement.getId())); - //@author Brath - //避免空集合导致的NULL空指针 - if (formInfoList.size() == 0) - continue; + + //@update by Brath:避免空集合导致的NULL空指针 + WfDeployFormVo formInfo = formInfoList.stream().findFirst().orElse(null); - WfDeployFormVo formInfo = formInfoList.iterator().next(); if (ObjectUtil.isNotNull(formInfo)) { // 旧数据 formInfo.getFormName() 为 null String formName = Optional.ofNullable(formInfo.getFormName()).orElse(StringUtils.EMPTY);