mirror of https://github.com/apache/nifi.git
NIFI-1404: Fixed NPE that resulted on startup if there was a Provenance file that had no events
Signed-off-by: joewitt <joewitt@apache.org>
This commit is contained in:
parent
fca0b4c433
commit
925138b6c4
|
@ -1028,7 +1028,9 @@ public class PersistentProvenanceRepository implements ProvenanceEventRepository
|
||||||
for (final File logFile : logFiles) {
|
for (final File logFile : logFiles) {
|
||||||
try (final RecordReader reader = RecordReaders.newRecordReader(logFile, null, Integer.MAX_VALUE)) {
|
try (final RecordReader reader = RecordReaders.newRecordReader(logFile, null, Integer.MAX_VALUE)) {
|
||||||
final StandardProvenanceEventRecord event = reader.nextRecord();
|
final StandardProvenanceEventRecord event = reader.nextRecord();
|
||||||
return event.getEventTime();
|
if (event != null) {
|
||||||
|
return event.getEventTime();
|
||||||
|
}
|
||||||
} catch (final IOException ioe) {
|
} catch (final IOException ioe) {
|
||||||
logger.warn("Failed to obtain timestamp of first event from Provenance Event Log File {}", logFile);
|
logger.warn("Failed to obtain timestamp of first event from Provenance Event Log File {}", logFile);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue