Skip to content

Commit

Permalink
Fix NPE for PushStatsToSource
Browse files Browse the repository at this point in the history
  • Loading branch information
craigtaverner committed Oct 31, 2024
1 parent b2cb257 commit b95d1f0
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ public long count() {
}

public long count(String field) {
var stat = cache.computeIfAbsent(field, s -> new FieldStat());
var stat = cache.computeIfAbsent(field, this::makeFieldStat);
if (stat.count == null) {
var count = new long[] { 0 };
boolean completed = doWithContexts(r -> {
Expand Down Expand Up @@ -156,7 +156,7 @@ public boolean hasDocValues(String field) {
}

public byte[] min(String field, DataType dataType) {
var stat = cache.computeIfAbsent(field, s -> new FieldStat());
var stat = cache.computeIfAbsent(field, this::makeFieldStat);
if (stat.min == null) {
var min = new byte[][] { null };
doWithContexts(r -> {
Expand All @@ -178,7 +178,7 @@ public byte[] min(String field, DataType dataType) {
}

public byte[] max(String field, DataType dataType) {
var stat = cache.computeIfAbsent(field, s -> new FieldStat());
var stat = cache.computeIfAbsent(field, this::makeFieldStat);
if (stat.max == null) {
var max = new byte[][] { null };
doWithContexts(r -> {
Expand All @@ -200,7 +200,7 @@ public byte[] max(String field, DataType dataType) {
}

public boolean isSingleValue(String field) {
var stat = cache.computeIfAbsent(field, s -> new FieldStat());
var stat = cache.computeIfAbsent(field, this::makeFieldStat);
if (stat.singleValue == null) {
// there's no such field so no need to worry about multi-value fields
if (exists(field) == false) {
Expand Down

0 comments on commit b95d1f0

Please sign in to comment.