rfellows commented on code in PR #10732:
URL: https://github.com/apache/nifi/pull/10732#discussion_r2666220821
##########
nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/java/org/apache/nifi/web/api/dto/DtoFactory.java:
##########
@@ -5262,7 +5262,13 @@ public ConnectorDTO createConnectorDto(final
ConnectorNode connector) {
dto.setBundle(createBundleDto(connector.getBundleCoordinate()));
dto.setState(connector.getCurrentState().name());
-
dto.setActiveConfiguration(createConnectorConfigurationDtoFromFlowContext(connector,
connector.getActiveFlowContext()));
+
+ final FrameworkFlowContext activeFlowContext =
connector.getActiveFlowContext();
+ if (activeFlowContext != null &&
activeFlowContext.getManagedProcessGroup() != null) {
+
dto.setManagedProcessGroupId(activeFlowContext.getManagedProcessGroup().getIdentifier());
+ }
Review Comment:
There's an implicit guarantee that getActiveFlowContext() is never null.
There are a handful of other instances where we get the active flow context and
assume it is non-null. For consistency, we should probably remove the guard as
to not confuse future devs that this can possibly be null.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]