mirror of
https://github.com/DSpace/DSpace.git
synced 2025-10-18 15:33:09 +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() {
|
public InputStream nextElement() {
|
||||||
InputStream inputStream;
|
InputStream inputStream = null;
|
||||||
|
|
||||||
FullTextBitstream bitstream = null;
|
FullTextBitstream bitstream = null;
|
||||||
|
|
||||||
try {
|
try {
|
||||||
bitstream = fulltextIterator.next();
|
bitstream = fulltextIterator.next();
|
||||||
inputStream = bitstream.getInputStream();
|
inputStream = bitstream.getInputStream();
|
||||||
@@ -203,7 +203,8 @@ public class FullTextContentStreams extends ContentStreamBase
|
|||||||
inputStream = new ByteArrayInputStream((e.getClass() + ": " + e.getMessage()).getBytes(StandardCharsets.UTF_8));
|
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