From 0ea6d233c0c4f65071b7abb89857067ed4eba2e4 Mon Sep 17 00:00:00 2001 From: Pascal Christoph Date: Fri, 27 Sep 2024 14:56:05 +0200 Subject: [PATCH] Don't write footer when record is empty (#543) Complements 29a5be14ab8e9acc54a46167289c599d65ed4859. --- .../java/org/metafacture/biblio/marc21/MarcXmlEncoder.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/metafacture-biblio/src/main/java/org/metafacture/biblio/marc21/MarcXmlEncoder.java b/metafacture-biblio/src/main/java/org/metafacture/biblio/marc21/MarcXmlEncoder.java index feecd64e..e754bb70 100644 --- a/metafacture-biblio/src/main/java/org/metafacture/biblio/marc21/MarcXmlEncoder.java +++ b/metafacture-biblio/src/main/java/org/metafacture/biblio/marc21/MarcXmlEncoder.java @@ -372,7 +372,9 @@ protected void onResetStream() { @Override protected void onCloseStream() { - writeFooter(); + if (!atStreamStart) { + writeFooter(); + } sendAndClearData(); }