Protecting against possible NPE in ImportFlowVersion command in CLI
This closes
@@ -89,7 +89,11 @@ public class ImportFlowVersion extends AbstractNiFiRegistryCommand<StringResult>
metadata.setBucketIdentifier(versionedFlow.getBucketIdentifier());
metadata.setFlowIdentifier(flowId);
metadata.setVersion(version);
- metadata.setComments(deserializedSnapshot.getSnapshotMetadata().getComments());
+
+ final VersionedFlowSnapshotMetadata deserializedSnapshotMetadata = deserializedSnapshot.getSnapshotMetadata();
+ if (deserializedSnapshotMetadata != null) {
+ metadata.setComments(deserializedSnapshotMetadata.getComments());
+ }
// create a new snapshot using the new metadata and the contents from the deserialized snapshot
final VersionedFlowSnapshot snapshot = new VersionedFlowSnapshot();
