Fix null checks

Signed-off-by: Harsha Vamsi Kalluri <harshavamsi096@gmail.com>
This commit is contained in:
Harsha Vamsi Kalluri 2024-09-10 10:05:44 -07:00
parent 2d85231f34
commit feb824e209
1 changed files with 7 additions and 3 deletions

View File

@ -512,7 +512,7 @@ public class QueryUtils {
@Override @Override
public LeafReader getLastReader() { public LeafReader getLastReader() {
return null; return lastReader;
} }
}; };
} }
@ -522,8 +522,10 @@ public class QueryUtils {
Collection<SimpleCollectorWithLastReader> collectors) { Collection<SimpleCollectorWithLastReader> collectors) {
List<LeafReader> lastReaders = new ArrayList<>(); List<LeafReader> lastReaders = new ArrayList<>();
for (SimpleCollectorWithLastReader collector : collectors) { for (SimpleCollectorWithLastReader collector : collectors) {
if (collector.getLastReader() != null) {
lastReaders.add(collector.getLastReader()); lastReaders.add(collector.getLastReader());
} }
}
return lastReaders; return lastReaders;
} }
}); });
@ -692,8 +694,10 @@ public class QueryUtils {
public List<LeafReader> reduce(Collection<SimpleCollectorWithLastReader> collectors) { public List<LeafReader> reduce(Collection<SimpleCollectorWithLastReader> collectors) {
List<LeafReader> lastReaders = new ArrayList<>(); List<LeafReader> lastReaders = new ArrayList<>();
for (SimpleCollectorWithLastReader collector : collectors) { for (SimpleCollectorWithLastReader collector : collectors) {
if (collector.getLastReader() != null) {
lastReaders.add(collector.getLastReader()); lastReaders.add(collector.getLastReader());
} }
}
return lastReaders; return lastReaders;
} }
}); });