diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-cluster/src/main/java/org/apache/nifi/cluster/coordination/http/endpoints/ParameterContextMerger.java b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-cluster/src/main/java/org/apache/nifi/cluster/coordination/http/endpoints/ParameterContextMerger.java index 7278b54289..805aff7720 100644 --- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-cluster/src/main/java/org/apache/nifi/cluster/coordination/http/endpoints/ParameterContextMerger.java +++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-cluster/src/main/java/org/apache/nifi/cluster/coordination/http/endpoints/ParameterContextMerger.java @@ -142,7 +142,7 @@ public class ParameterContextMerger { final AffectedComponentDTO mergedComponent = merged.getComponent(); final AffectedComponentDTO additionalComponent = additional.getComponent(); - mergedComponent.setActiveThreadCount(mergedComponent.getActiveThreadCount() + additionalComponent.getActiveThreadCount()); + mergedComponent.setActiveThreadCount(add(mergedComponent.getActiveThreadCount(), additionalComponent.getActiveThreadCount())); if (mergedComponent.getValidationErrors() == null) { mergedComponent.setValidationErrors(new ArrayList<>()); @@ -152,4 +152,14 @@ public class ParameterContextMerger { mergedComponent.getValidationErrors().addAll(additionalComponent.getValidationErrors()); } } + + private static Integer add(final Integer a, final Integer b) { + if (a == null) { + return b; + } + if (b == null) { + return a; + } + return a + b; + } }