Fixed NPE that is thrown when clustered and using parameters from Controller Services
This closes
@@ -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;
+ }
}
