From f4090ec01c5b0d11fa7d1857a59e777208102ad3 Mon Sep 17 00:00:00 2001 From: wangliwen Date: Thu, 28 Apr 2022 21:37:47 +0800 Subject: [PATCH] npe --- .../modules/activiti/service/ActTaskService.java | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/renren-admin/src/main/java/io/renren/modules/activiti/service/ActTaskService.java b/renren-admin/src/main/java/io/renren/modules/activiti/service/ActTaskService.java index b3abfd8d..3b3137a2 100644 --- a/renren-admin/src/main/java/io/renren/modules/activiti/service/ActTaskService.java +++ b/renren-admin/src/main/java/io/renren/modules/activiti/service/ActTaskService.java @@ -512,12 +512,15 @@ public class ActTaskService extends BaseServiceImpl { dto.setProcessDefinitionName(processDefinition.getName()); dto.setProcessDefinitionKey(processDefinition.getKey()); HistoricProcessInstance processInstance = historyService.createHistoricProcessInstanceQuery().processInstanceId(task.getProcessInstanceId()).singleResult(); - dto.setStartTime(processInstance.getStartTime()); - dto.setBusinessKey(processInstance.getBusinessKey()); - dto.setProcessInstanceId(task.getProcessInstanceId()); - dto.setOwner(task.getOwner()); - dto.setCreateTime(task.getCreateTime()); - dto.setDueDate(task.getDueDate()); + if (processInstance != null) { + dto.setStartTime(processInstance.getStartTime()); + dto.setBusinessKey(processInstance.getBusinessKey()); + dto.setProcessInstanceId(task.getProcessInstanceId()); + dto.setOwner(task.getOwner()); + dto.setCreateTime(task.getCreateTime()); + dto.setDueDate(task.getDueDate()); + } + } /**