Skip to content

Commit

Permalink
fix NPE of cache load
Browse files Browse the repository at this point in the history
Signed-off-by: Murphy <[email protected]>
  • Loading branch information
murphyatwork committed Dec 16, 2024
1 parent 884981f commit 1b209e5
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -627,7 +627,11 @@ private <K, V> Pair<List<Object>, Long> sampleFromCache(AsyncLoadingCache<K, V>
V value = null;
try {
value = next.getValue().getNow(null);
} catch (Exception ignored) {
} catch (Exception e) {
LOG.warn("sample load statistic cache failed", e);
}
if (value == null) {
return Pair.create(List.of(next.getKey()), cache.synchronous().estimatedSize());
}
return Pair.create(List.of(next.getKey(), value), cache.synchronous().estimatedSize());
}
Expand Down

0 comments on commit 1b209e5

Please sign in to comment.