mirror of https://github.com/apache/lucene.git
LUCENE-8196: Check for a null input in LowpassIntervalsSource
This commit is contained in:
parent
34b83ed869
commit
7117b68db6
|
@ -18,6 +18,7 @@
|
|||
package org.apache.lucene.search.intervals;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
* Wraps an {@link IntervalIterator} and passes through those intervals that match the {@link #accept()} function
|
||||
|
@ -30,7 +31,7 @@ public abstract class IntervalFilter extends IntervalIterator {
|
|||
* Create a new filter
|
||||
*/
|
||||
public IntervalFilter(IntervalIterator in) {
|
||||
this.in = in;
|
||||
this.in = Objects.requireNonNull(in);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -56,6 +56,9 @@ class LowpassIntervalsSource extends IntervalsSource {
|
|||
@Override
|
||||
public IntervalIterator intervals(String field, LeafReaderContext ctx) throws IOException {
|
||||
IntervalIterator i = in.intervals(field, ctx);
|
||||
if (i == null) {
|
||||
return null;
|
||||
}
|
||||
return new IntervalFilter(i) {
|
||||
@Override
|
||||
protected boolean accept() {
|
||||
|
|
Loading…
Reference in New Issue