diff --git a/nifi-framework-bundle/nifi-framework-extensions/nifi-provenance-repository-bundle/nifi-persistent-provenance-repository/src/main/java/org/apache/nifi/provenance/index/lucene/LuceneEventIndex.java b/nifi-framework-bundle/nifi-framework-extensions/nifi-provenance-repository-bundle/nifi-persistent-provenance-repository/src/main/java/org/apache/nifi/provenance/index/lucene/LuceneEventIndex.java index d137ee5fcd..63a5401ac0 100644 --- a/nifi-framework-bundle/nifi-framework-extensions/nifi-provenance-repository-bundle/nifi-persistent-provenance-repository/src/main/java/org/apache/nifi/provenance/index/lucene/LuceneEventIndex.java +++ b/nifi-framework-bundle/nifi-framework-extensions/nifi-provenance-repository-bundle/nifi-persistent-provenance-repository/src/main/java/org/apache/nifi/provenance/index/lucene/LuceneEventIndex.java @@ -758,6 +758,11 @@ public class LuceneEventIndex implements EventIndex { @Override public AsyncLineageSubmission retrieveLineageSubmission(final String lineageIdentifier, final NiFiUser user) { final AsyncLineageSubmission submission = lineageSubmissionMap.get(lineageIdentifier); + + if (submission == null) { + throw new AccessDeniedException("Cannot retrieve Provenance Lineage Submission. It has already been deleted or submitted to another NiFi node in the cluster."); + } + final String userId = submission.getSubmitterIdentity(); if (user == null && userId == null) {