From d2e318502e889ddc1731dc9271c47dc565d8f05f Mon Sep 17 00:00:00 2001 From: Enrique Gonzalez Martinez Date: Tue, 1 Oct 2024 09:37:07 +0200 Subject: [PATCH] fix null pointer exception --- .../org/kie/kogito/usertask/impl/InMemoryUserTaskInstances.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/jbpm/jbpm-usertask/src/main/java/org/kie/kogito/usertask/impl/InMemoryUserTaskInstances.java b/jbpm/jbpm-usertask/src/main/java/org/kie/kogito/usertask/impl/InMemoryUserTaskInstances.java index 55da7c4c0e2..def2088da39 100644 --- a/jbpm/jbpm-usertask/src/main/java/org/kie/kogito/usertask/impl/InMemoryUserTaskInstances.java +++ b/jbpm/jbpm-usertask/src/main/java/org/kie/kogito/usertask/impl/InMemoryUserTaskInstances.java @@ -70,7 +70,7 @@ public void setDisconnectUserTaskInstance(Function findById(String userTaskInstanceId) { try { if (!userTaskInstances.containsKey(userTaskInstanceId)) { - return null; + return Optional.empty(); } UserTaskInstance userTaskInstance = mapper.readValue(userTaskInstances.get(userTaskInstanceId), DefaultUserTaskInstance.class); return Optional.ofNullable(reconnectUserTaskInstance.apply(userTaskInstance));