mirror of https://github.com/apache/nifi.git
NIFI-9834: When calling ByteArrayContentRepository.read() on a null Content Claim, return an empty ByteArrayInputStream instead of throwing NullPointerException
This closes #5903. Signed-off-by: Peter Turcsanyi <turcsanyi@apache.org>
This commit is contained in:
parent
63f02c99bf
commit
16c9bd535b
|
@ -215,12 +215,16 @@ public class ByteArrayContentRepository implements ContentRepository {
|
|||
|
||||
@Override
|
||||
public InputStream read(final ContentClaim claim) {
|
||||
if (claim == null) {
|
||||
return new ByteArrayInputStream(new byte[0]);
|
||||
}
|
||||
|
||||
final ByteArrayContentClaim byteArrayContentClaim = verifyClaim(claim);
|
||||
return byteArrayContentClaim.read();
|
||||
}
|
||||
|
||||
@Override
|
||||
public InputStream read(final ResourceClaim claim) throws IOException {
|
||||
public InputStream read(final ResourceClaim claim) {
|
||||
if (claim == null) {
|
||||
return new ByteArrayInputStream(new byte[0]);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue