diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-components/src/main/java/org/apache/nifi/controller/service/StandardControllerServiceNode.java b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-components/src/main/java/org/apache/nifi/controller/service/StandardControllerServiceNode.java index e75fb3c5ec..c9b632be63 100644 --- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-components/src/main/java/org/apache/nifi/controller/service/StandardControllerServiceNode.java +++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-components/src/main/java/org/apache/nifi/controller/service/StandardControllerServiceNode.java @@ -257,8 +257,14 @@ public class StandardControllerServiceNode extends AbstractComponentNode impleme for (Entry entry : getEffectivePropertyValues().entrySet()) { PropertyDescriptor descriptor = entry.getKey(); if (descriptor.getControllerServiceDefinition() != null && entry.getValue() != null) { - ControllerServiceNode requiredNode = serviceProvider.getControllerServiceNode(entry.getValue()); - requiredServices.add(requiredNode); + // CS property could point to a non-existent CS, so protect against requiredNode being null + final String referenceId = entry.getValue(); + final ControllerServiceNode requiredNode = serviceProvider.getControllerServiceNode(referenceId); + if (requiredNode != null) { + requiredServices.add(requiredNode); + } else { + LOG.warn("Unable to locate referenced controller service with id {}", referenceId); + } } } return new ArrayList<>(requiredServices);