From 7fdba369415a3882df5f83ce6197a2f638b37fad Mon Sep 17 00:00:00 2001 From: Adrien Grand Date: Wed, 5 Jan 2022 16:37:06 +0100 Subject: [PATCH] LUCENE-10291: Bug fix. --- .../java/org/apache/lucene/tests/index/MergeReaderWrapper.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lucene/test-framework/src/java/org/apache/lucene/tests/index/MergeReaderWrapper.java b/lucene/test-framework/src/java/org/apache/lucene/tests/index/MergeReaderWrapper.java index ba7e97fcc55..c6da7475f80 100644 --- a/lucene/test-framework/src/java/org/apache/lucene/tests/index/MergeReaderWrapper.java +++ b/lucene/test-framework/src/java/org/apache/lucene/tests/index/MergeReaderWrapper.java @@ -95,6 +95,9 @@ class MergeReaderWrapper extends LeafReader { // We could check the FieldInfo IndexOptions but there's no point since // PostingsReader will simply return null for fields that don't exist or that have no terms // index. + if (fields == null) { + return null; + } return fields.terms(field); }