mirror of https://github.com/apache/lucene.git
LUCENE-6039: add another null check
git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1637541 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
ca8681a449
commit
f7e6d2f177
|
@ -140,6 +140,9 @@ public final class FieldInfo {
|
|||
}
|
||||
|
||||
void setDocValuesType(DocValuesType type) {
|
||||
if (type == null) {
|
||||
throw new NullPointerException("DocValuesType cannot be null (field: \"" + name + "\")");
|
||||
}
|
||||
if (docValuesType != DocValuesType.NONE && type != DocValuesType.NONE && docValuesType != type) {
|
||||
throw new IllegalArgumentException("cannot change DocValues type from " + docValuesType + " to " + type + " for field \"" + name + "\"");
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue