SOLR-12978: In autoscaling NPE thrown for nodes where value is absent

This commit is contained in:
Noble Paul 2018-11-12 18:53:16 +11:00
parent e6e6ad2c83
commit cd1e829732
2 changed files with 3 additions and 0 deletions

View File

@ -290,6 +290,8 @@ used with DVHASH method in json.facet. (Tim Underwood via Mikhail Khludnev)
* SOLR-12977: Autoscaling tries to fetch metrics from dead nodes (noble) * SOLR-12977: Autoscaling tries to fetch metrics from dead nodes (noble)
* SOLR-12978: In autoscaling NPE thrown for nodes where value is absent (noble)
Improvements Improvements
---------------------- ----------------------

View File

@ -31,6 +31,7 @@ class RangeVal implements MapWriter {
} }
public boolean match(Number testVal) { public boolean match(Number testVal) {
if (testVal == null) return false;
return Double.compare(testVal.doubleValue(), min.doubleValue()) >= 0 && return Double.compare(testVal.doubleValue(), min.doubleValue()) >= 0 &&
Double.compare(testVal.doubleValue(), max.doubleValue()) <= 0; Double.compare(testVal.doubleValue(), max.doubleValue()) <= 0;
} }