From f8c216b0617068995aa7a4575cd6298f0e59378d Mon Sep 17 00:00:00 2001 From: Mark Payne Date: Mon, 31 Aug 2015 10:50:00 -0400 Subject: [PATCH] NIFI-903: Check for null value before trying to close 'out' OutputStream on StandardRecordWriter.close --- .../org/apache/nifi/provenance/StandardRecordWriter.java | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/nifi-nar-bundles/nifi-provenance-repository-bundle/nifi-persistent-provenance-repository/src/main/java/org/apache/nifi/provenance/StandardRecordWriter.java b/nifi-nar-bundles/nifi-provenance-repository-bundle/nifi-persistent-provenance-repository/src/main/java/org/apache/nifi/provenance/StandardRecordWriter.java index a8c0dd0d7b..b95d80553a 100644 --- a/nifi-nar-bundles/nifi-provenance-repository-bundle/nifi-persistent-provenance-repository/src/main/java/org/apache/nifi/provenance/StandardRecordWriter.java +++ b/nifi-nar-bundles/nifi-provenance-repository-bundle/nifi-persistent-provenance-repository/src/main/java/org/apache/nifi/provenance/StandardRecordWriter.java @@ -274,8 +274,13 @@ public class StandardRecordWriter implements RecordWriter { lock(); try { try { - out.flush(); - out.close(); + if (out != null) { + try { + out.flush(); + } finally { + out.close(); + } + } } finally { rawOutStream.close();