From ce0fa2a6a6e47eefc21eb52cea2bcae436f1f676 Mon Sep 17 00:00:00 2001 From: Zhang Chao <80152403@qq.com> Date: Wed, 7 Feb 2024 20:14:01 +0800 Subject: [PATCH] Fix NPE in TestReqOptSumScorer.testFilterRandomRareOpt #13069 --- .../src/java/org/apache/lucene/tests/search/CheckHits.java | 3 +++ 1 file changed, 3 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 217bd834d9e..9d708339d51 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 @@ -733,6 +733,9 @@ public class CheckHits { assertTrue(s2 == null || s2.iterator().nextDoc() == DocIdSetIterator.NO_MORE_DOCS); continue; } + if (s2 == null) { + continue; + } TwoPhaseIterator twoPhase1 = s1.twoPhaseIterator(); TwoPhaseIterator twoPhase2 = s2.twoPhaseIterator(); DocIdSetIterator approx1 = twoPhase1 == null ? s1.iterator() : twoPhase1.approximation();