From 6732d2b2faed66169ea60ac0b52970138c45ba6f Mon Sep 17 00:00:00 2001 From: Zhang Chao <80152403@qq.com> Date: Thu, 22 Feb 2024 14:11:07 +0800 Subject: [PATCH] fix (#13122) --- .../src/java/org/apache/lucene/tests/search/CheckHits.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lucene/test-framework/src/java/org/apache/lucene/tests/search/CheckHits.java b/lucene/test-framework/src/java/org/apache/lucene/tests/search/CheckHits.java index e01fc3877a8..3c6bb891c92 100644 --- a/lucene/test-framework/src/java/org/apache/lucene/tests/search/CheckHits.java +++ b/lucene/test-framework/src/java/org/apache/lucene/tests/search/CheckHits.java @@ -793,6 +793,10 @@ public class CheckHits { assertTrue(s2 == null || s2.iterator().nextDoc() == DocIdSetIterator.NO_MORE_DOCS); continue; } + if (s2 == null) { + assertTrue(s1.iterator().nextDoc() == DocIdSetIterator.NO_MORE_DOCS); + continue; + } TwoPhaseIterator twoPhase1 = s1.twoPhaseIterator(); TwoPhaseIterator twoPhase2 = s2.twoPhaseIterator(); DocIdSetIterator approx1 = twoPhase1 == null ? s1.iterator() : twoPhase1.approximation();