mirror of https://github.com/apache/nifi.git
NIFI-7224 Protecting against possible NPE in ImportFlowVersion command in CLI
Signed-off-by: Pierre Villard <pierre.villard.fr@gmail.com> This closes #4121.
This commit is contained in:
parent
578430c9d9
commit
ac4d52b6ca
|
@ -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();
|
||||
|
|
Loading…
Reference in New Issue