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:
Bernhard Messer 2004-11-21 22:32:49 +00:00
parent bb6c0124d8
commit b77b25d52b
2 changed files with 10 additions and 0 deletions

View File

@ -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);
}
}

View File

@ -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();