This is an automated email from the ASF dual-hosted git repository.

joewitt pushed a commit to branch support/nifi-1.x
in repository https://gitbox.apache.org/repos/asf/nifi.git


The following commit(s) were added to refs/heads/support/nifi-1.x by this push:
     new 51577ff20a NIFI-11176: When comparing a VersionedConnection with an 
existing connection, we examined the source component's VersionedComponentId. 
But the existing component may not have a VersionedComponentId. We should only 
be comparing these if they are populated
51577ff20a is described below

commit 51577ff20af366b5640626bf9cc5d9cc4f3c430a
Author: Mark Payne <marka...@hotmail.com>
AuthorDate: Mon Feb 13 18:19:22 2023 -0500

    NIFI-11176: When comparing a VersionedConnection with an existing 
connection, we examined the source component's VersionedComponentId. But the 
existing component may not have a VersionedComponentId. We should only be 
comparing these if they are populated
    
    Signed-off-by: Joe Witt <joew...@apache.org>
---
 .../flow/synchronization/StandardVersionedComponentSynchronizer.java    | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git 
a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-components/src/main/java/org/apache/nifi/flow/synchronization/StandardVersionedComponentSynchronizer.java
 
b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-components/src/main/java/org/apache/nifi/flow/synchronization/StandardVersionedComponentSynchronizer.java
index 553c3d6f40..5659567149 100644
--- 
a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-components/src/main/java/org/apache/nifi/flow/synchronization/StandardVersionedComponentSynchronizer.java
+++ 
b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-components/src/main/java/org/apache/nifi/flow/synchronization/StandardVersionedComponentSynchronizer.java
@@ -635,7 +635,7 @@ public class StandardVersionedComponentSynchronizer 
implements VersionedComponen
                 final String proposedSourceId = 
proposedConnection.getSource().getId();
                 final String existingSourceId = 
existingConnection.getSource().getVersionedComponentId().orElse(null);
 
-                if (!Objects.equals(proposedSourceId, existingSourceId)) {
+                if (existingSourceId != null && 
!Objects.equals(proposedSourceId, existingSourceId)) {
                     
connectionsRemovedDueToChangingSourceId.add(proposedConnection.getIdentifier());
                     connectionsRemoved.add(proposedConnection.getIdentifier());
                 }

Reply via email to