Repository: nifi Updated Branches: refs/heads/master 4b4c9e14c -> 030129c7c
NIFI-5618: Avoid NPE when viewing Provenance Event details on a disconnected node Signed-off-by: Pierre Villard <[email protected]> This closes #3027. Project: http://git-wip-us.apache.org/repos/asf/nifi/repo Commit: http://git-wip-us.apache.org/repos/asf/nifi/commit/030129c7 Tree: http://git-wip-us.apache.org/repos/asf/nifi/tree/030129c7 Diff: http://git-wip-us.apache.org/repos/asf/nifi/diff/030129c7 Branch: refs/heads/master Commit: 030129c7ceacfd4e32db5dc1d00d6c86c8c3aaa7 Parents: 4b4c9e1 Author: Mark Payne <[email protected]> Authored: Mon Sep 24 15:16:35 2018 -0400 Committer: Pierre Villard <[email protected]> Committed: Tue Sep 25 12:28:58 2018 +0200 ---------------------------------------------------------------------- .../java/org/apache/nifi/web/api/ProvenanceEventResource.java | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/nifi/blob/030129c7/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/java/org/apache/nifi/web/api/ProvenanceEventResource.java ---------------------------------------------------------------------- diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/java/org/apache/nifi/web/api/ProvenanceEventResource.java b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/java/org/apache/nifi/web/api/ProvenanceEventResource.java index 074334b..6cc2343 100644 --- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/java/org/apache/nifi/web/api/ProvenanceEventResource.java +++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/java/org/apache/nifi/web/api/ProvenanceEventResource.java @@ -294,9 +294,12 @@ public class ProvenanceEventResource extends ApplicationResource { // populate the cluster node address final ClusterCoordinator coordinator = getClusterCoordinator(); - if (coordinator != null) { + if (coordinator != null && clusterNodeId != null) { final NodeIdentifier nodeId = coordinator.getNodeIdentifier(clusterNodeId); - event.setClusterNodeAddress(nodeId.getApiAddress() + ":" + nodeId.getApiPort()); + + if (nodeId != null) { + event.setClusterNodeAddress(nodeId.getApiAddress() + ":" + nodeId.getApiPort()); + } } // create a response entity
