mirror of https://github.com/apache/lucene.git
Fix for bug: 31976, avoid NullPointerException when adding a document with an single, empty field and term vectors enabled.
git-svn-id: https://svn.apache.org/repos/asf/lucene/java/trunk@150655 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
bb6c0124d8
commit
b77b25d52b
|
@ -489,6 +489,9 @@ class SegmentReader extends IndexReader {
|
|||
return null;
|
||||
|
||||
TermVectorsReader termVectorsReader = getTermVectorsReader();
|
||||
if (termVectorsReader == null)
|
||||
return null;
|
||||
|
||||
return termVectorsReader.get(docNumber, field);
|
||||
}
|
||||
|
||||
|
@ -505,6 +508,9 @@ class SegmentReader extends IndexReader {
|
|||
return null;
|
||||
|
||||
TermVectorsReader termVectorsReader = getTermVectorsReader();
|
||||
if (termVectorsReader == null)
|
||||
return null;
|
||||
|
||||
return termVectorsReader.get(docNumber);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -295,6 +295,10 @@ class TermVectorsReader implements Cloneable {
|
|||
}
|
||||
|
||||
protected Object clone() {
|
||||
|
||||
if (tvx == null || tvd == null || tvf == null)
|
||||
return null;
|
||||
|
||||
TermVectorsReader clone = null;
|
||||
try {
|
||||
clone = (TermVectorsReader) super.clone();
|
||||
|
|
Loading…
Reference in New Issue