Skip to content

Commit

Permalink
TIKA-4252: fix metadata issue (#1752)
Browse files Browse the repository at this point in the history
Co-authored-by: Nicholas DiPiazza <ndipiazza@apache.org>
  • Loading branch information
nddipiazza and Nicholas DiPiazza committed May 9, 2024
1 parent 84d05ad commit 2f8dbdf
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 2f8dbdf

Please sign in to comment.