You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nifi.apache.org by jo...@apache.org on 2016/01/26 04:07:50 UTC

nifi git commit: NIFI-1404: Fixed NPE that resulted on startup if there was a Provenance file that had no events

Repository: nifi
Updated Branches:
  refs/heads/master fca0b4c43 -> 925138b6c


NIFI-1404: Fixed NPE that resulted on startup if there was a Provenance file that had no events

Signed-off-by: joewitt <jo...@apache.org>


Project: http://git-wip-us.apache.org/repos/asf/nifi/repo
Commit: http://git-wip-us.apache.org/repos/asf/nifi/commit/925138b6
Tree: http://git-wip-us.apache.org/repos/asf/nifi/tree/925138b6
Diff: http://git-wip-us.apache.org/repos/asf/nifi/diff/925138b6

Branch: refs/heads/master
Commit: 925138b6c443ca5e2b9129c379298d6e99582d8e
Parents: fca0b4c
Author: Mark Payne <ma...@hotmail.com>
Authored: Mon Jan 25 16:48:56 2016 -0500
Committer: joewitt <jo...@apache.org>
Committed: Mon Jan 25 21:55:48 2016 -0500

----------------------------------------------------------------------
 .../apache/nifi/provenance/PersistentProvenanceRepository.java   | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/nifi/blob/925138b6/nifi-nar-bundles/nifi-provenance-repository-bundle/nifi-persistent-provenance-repository/src/main/java/org/apache/nifi/provenance/PersistentProvenanceRepository.java
----------------------------------------------------------------------
diff --git a/nifi-nar-bundles/nifi-provenance-repository-bundle/nifi-persistent-provenance-repository/src/main/java/org/apache/nifi/provenance/PersistentProvenanceRepository.java b/nifi-nar-bundles/nifi-provenance-repository-bundle/nifi-persistent-provenance-repository/src/main/java/org/apache/nifi/provenance/PersistentProvenanceRepository.java
index 2b7843a..3d24d11 100644
--- a/nifi-nar-bundles/nifi-provenance-repository-bundle/nifi-persistent-provenance-repository/src/main/java/org/apache/nifi/provenance/PersistentProvenanceRepository.java
+++ b/nifi-nar-bundles/nifi-provenance-repository-bundle/nifi-persistent-provenance-repository/src/main/java/org/apache/nifi/provenance/PersistentProvenanceRepository.java
@@ -1028,7 +1028,9 @@ public class PersistentProvenanceRepository implements ProvenanceEventRepository
         for (final File logFile : logFiles) {
             try (final RecordReader reader = RecordReaders.newRecordReader(logFile, null, Integer.MAX_VALUE)) {
                 final StandardProvenanceEventRecord event = reader.nextRecord();
-                return event.getEventTime();
+                if (event != null) {
+                    return event.getEventTime();
+                }
             } catch (final IOException ioe) {
                 logger.warn("Failed to obtain timestamp of first event from Provenance Event Log File {}", logFile);
             }