lucene 4: fix possible NPE in range queries and filters if one of the bounds is not specified
This commit is contained in:
parent
6d40770200
commit
74464f9f99
|
@ -118,7 +118,7 @@ public class RangeFilterParser implements FilterParser {
|
|||
if (smartNameFieldMappers != null) {
|
||||
if (smartNameFieldMappers.hasMapper()) {
|
||||
//LUCENE 4 UPGRADE range filter should use bytesref too?
|
||||
filter = smartNameFieldMappers.mapper().rangeFilter(from.utf8ToString(), to.utf8ToString(), includeLower, includeUpper, parseContext);
|
||||
filter = smartNameFieldMappers.mapper().rangeFilter(from != null ? from.utf8ToString() : null, to != null ? to.utf8ToString() : null, includeLower, includeUpper, parseContext);
|
||||
}
|
||||
}
|
||||
if (filter == null) {
|
||||
|
|
|
@ -110,7 +110,7 @@ public class RangeQueryParser implements QueryParser {
|
|||
if (smartNameFieldMappers != null) {
|
||||
if (smartNameFieldMappers.hasMapper()) {
|
||||
//LUCENE 4 UPGRADE Mapper#rangeQuery should use bytesref as well?
|
||||
query = smartNameFieldMappers.mapper().rangeQuery(from.utf8ToString(), to.utf8ToString(), includeLower, includeUpper, parseContext);
|
||||
query = smartNameFieldMappers.mapper().rangeQuery(from != null ? from.utf8ToString() : null, to != null ? to.utf8ToString() : null, includeLower, includeUpper, parseContext);
|
||||
}
|
||||
}
|
||||
if (query == null) {
|
||||
|
|
Loading…
Reference in New Issue