From 854acd7d02cc78a4f94cdaf0ffc30ab8faa47d2f Mon Sep 17 00:00:00 2001 From: erickgonzalez Date: Mon, 23 Sep 2024 16:23:21 -0600 Subject: [PATCH] #28580 include in 23.10.24 LTS --- dotCMS/hotfix_tracking.md | 1 + .../rest/api/v1/workflow/WorkflowResource.java | 13 +++---------- 2 files changed, 4 insertions(+), 10 deletions(-) diff --git a/dotCMS/hotfix_tracking.md b/dotCMS/hotfix_tracking.md index 568978c8b11f..a1d9766f5c02 100644 --- a/dotCMS/hotfix_tracking.md +++ b/dotCMS/hotfix_tracking.md @@ -152,3 +152,4 @@ This maintenance release includes the following code fixes: 145. https://github.com/dotCMS/core/issues/29256 : Many to One Relationships Not Copied in Copy Site #29256 146. https://github.com/dotCMS/core/issues/29392 : Saving folder names with special characters leads to incorrect encoding #29392 147. https://github.com/dotCMS/core/issues/29213 : Copying a contentlet without having Edit Permissions causes copy to have incorrect permissions. #29213 +148. https://github.com/dotCMS/core/issues/28580 : fix: avoid NPE on Patch WF API when there is not any contentlet map #28580 diff --git a/dotCMS/src/main/java/com/dotcms/rest/api/v1/workflow/WorkflowResource.java b/dotCMS/src/main/java/com/dotcms/rest/api/v1/workflow/WorkflowResource.java index a6cb355171b4..afe8975dacdc 100644 --- a/dotCMS/src/main/java/com/dotcms/rest/api/v1/workflow/WorkflowResource.java +++ b/dotCMS/src/main/java/com/dotcms/rest/api/v1/workflow/WorkflowResource.java @@ -112,15 +112,7 @@ import java.io.IOException; import java.io.OutputStream; import java.nio.charset.StandardCharsets; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.Collections; -import java.util.HashMap; -import java.util.LinkedHashSet; -import java.util.List; -import java.util.Map; -import java.util.Optional; -import java.util.Set; +import java.util.*; import java.util.concurrent.CompletionService; import java.util.concurrent.ExecutionException; import java.util.concurrent.ExecutorCompletionService; @@ -1939,7 +1931,8 @@ public final Response fireMergeActionDefault(@Context final HttpServletRequest r offset, null, initDataObject.getUser(), mode.respectAnonPerms); - final IndexPolicy indexPolicy = MapToContentletPopulator.recoverIndexPolicy(fireActionForm.getContentletFormData(), + final IndexPolicy indexPolicy = MapToContentletPopulator.recoverIndexPolicy( + (Objects.isNull(fireActionForm) || Objects.isNull(fireActionForm.getContentletFormData()))?Map.of():fireActionForm.getContentletFormData(), contentletSearches.size()> 10? IndexPolicy.DEFER: IndexPolicy.WAIT_FOR, request); for (final ContentletSearch contentletSearch : contentletSearches) {