From 98c3e7bdcdf0703c62b08441c86899a86d5b4302 Mon Sep 17 00:00:00 2001 From: Gabriele Zigurella Date: Mon, 27 Feb 2023 12:22:55 +0100 Subject: [PATCH] fix: handle nullable worlfowTask --- .../it/tref/liferay/portos/bo/util/WorkflowUtil.java | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/service/it/tref/liferay/portos/bo/util/WorkflowUtil.java b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/service/it/tref/liferay/portos/bo/util/WorkflowUtil.java index 5cb14586..9e284397 100644 --- a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/service/it/tref/liferay/portos/bo/util/WorkflowUtil.java +++ b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/service/it/tref/liferay/portos/bo/util/WorkflowUtil.java @@ -256,9 +256,11 @@ public class WorkflowUtil { ControlloPratica controlloPratica) throws PortalException, SystemException { WorkflowTask workflowTask = getLastTask(companyId, groupId, null, controlloPratica); - Map workflowContext = getWorkflowContext(controlloPratica); - WorkflowTaskManagerUtil.assignWorkflowTaskToUser(companyId, assegnatoreUserId, - workflowTask.getWorkflowTaskId(), istruttoreId, StringPool.BLANK, null, workflowContext); + if(workflowTask != null) { + Map workflowContext = getWorkflowContext(controlloPratica); + WorkflowTaskManagerUtil.assignWorkflowTaskToUser(companyId, assegnatoreUserId, + workflowTask.getWorkflowTaskId(), istruttoreId, StringPool.BLANK, null, workflowContext); + } } public static Map getWorkflowContext(ControlloPratica controlloPratica)