Skip to content

Commit

Permalink
TIKA-4252: fix metadata issue
Browse files Browse the repository at this point in the history
  • Loading branch information
Nicholas DiPiazza committed May 9, 2024
1 parent 63b7e91 commit 4428df0
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -462,7 +462,7 @@ protected MetadataListAndEmbeddedBytes parseFromTuple(FetchEmitTuple t, Fetcher
throw new IllegalArgumentException(
"fetch key has a range, but the fetcher is not a range fetcher");
}
Metadata metadata = new Metadata();
Metadata metadata = t.getMetadata() == null ? new Metadata() : t.getMetadata();
try (InputStream stream = ((RangeFetcher) fetcher).fetch(fetchKey.getFetchKey(),
fetchKey.getRangeStart(), fetchKey.getRangeEnd(), metadata)) {
return parseWithStream(t, stream, metadata);
Expand All @@ -474,7 +474,7 @@ protected MetadataListAndEmbeddedBytes parseFromTuple(FetchEmitTuple t, Fetcher
write(STATUS.FETCH_EXCEPTION, ExceptionUtils.getStackTrace(e));
}
} else {
Metadata metadata = new Metadata();
Metadata metadata = t.getMetadata() == null ? new Metadata() : t.getMetadata();
try (InputStream stream = fetcher.fetch(t.getFetchKey().getFetchKey(), metadata)) {
return parseWithStream(t, stream, metadata);
} catch (SecurityException e) {
Expand Down

0 comments on commit 4428df0

Please sign in to comment.