mirror of https://github.com/apache/lucene.git
SOLR-9805 Fix NPE.
This commit is contained in:
parent
bc8936a567
commit
687f03661d
|
@ -44,7 +44,7 @@ public class JvmMetricsTest extends SolrJettyTestBase {
|
|||
assertTrue(metrics.size() > 0);
|
||||
for (String metric : OperatingSystemMetricSet.METRICS) {
|
||||
Gauge<?> gauge = (Gauge<?>)metrics.get(metric);
|
||||
if (gauge == null) { // some are optional depending on OS
|
||||
if (gauge == null || gauge.getValue() == null) { // some are optional depending on OS
|
||||
continue;
|
||||
}
|
||||
double value = ((Number)gauge.getValue()).doubleValue();
|
||||
|
|
Loading…
Reference in New Issue