This is an automated email from the ASF dual-hosted git repository.
pvillard pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nifi.git
The following commit(s) were added to refs/heads/master by this push:
new ac4d52b NIFI-7224 Protecting against possible NPE in
ImportFlowVersion command in CLI
ac4d52b is described below
commit ac4d52b6ca7c4a11a8f3a303aebac3e3ebed6144
Author: Bryan Bende <[email protected]>
AuthorDate: Fri Mar 6 16:08:09 2020 -0500
NIFI-7224 Protecting against possible NPE in ImportFlowVersion command in
CLI
Signed-off-by: Pierre Villard <[email protected]>
This closes #4121.
---
.../toolkit/cli/impl/command/registry/flow/ImportFlowVersion.java | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git
a/nifi-toolkit/nifi-toolkit-cli/src/main/java/org/apache/nifi/toolkit/cli/impl/command/registry/flow/ImportFlowVersion.java
b/nifi-toolkit/nifi-toolkit-cli/src/main/java/org/apache/nifi/toolkit/cli/impl/command/registry/flow/ImportFlowVersion.java
index d9a3530..c02f38e 100644
---
a/nifi-toolkit/nifi-toolkit-cli/src/main/java/org/apache/nifi/toolkit/cli/impl/command/registry/flow/ImportFlowVersion.java
+++
b/nifi-toolkit/nifi-toolkit-cli/src/main/java/org/apache/nifi/toolkit/cli/impl/command/registry/flow/ImportFlowVersion.java
@@ -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();