diff --git a/solr/core/src/test/org/apache/solr/metrics/JvmMetricsTest.java b/solr/core/src/test/org/apache/solr/metrics/JvmMetricsTest.java index 77c4e1aa1c4..6d597cb0056 100644 --- a/solr/core/src/test/org/apache/solr/metrics/JvmMetricsTest.java +++ b/solr/core/src/test/org/apache/solr/metrics/JvmMetricsTest.java @@ -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();