mirror of
https://github.com/DSpace/DSpace.git
synced 2025-10-18 07:23:08 +00:00
DS-2952: Only prepend new line if we have an actual input stream
This commit is contained in:
@@ -189,9 +189,9 @@ public class FullTextContentStreams extends ContentStreamBase
|
||||
}
|
||||
|
||||
public InputStream nextElement() {
|
||||
InputStream inputStream;
|
||||
|
||||
InputStream inputStream = null;
|
||||
FullTextBitstream bitstream = null;
|
||||
|
||||
try {
|
||||
bitstream = fulltextIterator.next();
|
||||
inputStream = bitstream.getInputStream();
|
||||
@@ -203,7 +203,8 @@ public class FullTextContentStreams extends ContentStreamBase
|
||||
inputStream = new ByteArrayInputStream((e.getClass() + ": " + e.getMessage()).getBytes(StandardCharsets.UTF_8));
|
||||
}
|
||||
|
||||
return new SequenceInputStream(new ByteArrayInputStream("\n".getBytes(Charsets.UTF_8)), inputStream);
|
||||
return inputStream == null ? null : new SequenceInputStream(
|
||||
new ByteArrayInputStream("\n".getBytes(Charsets.UTF_8)), inputStream);
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user