commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From nico...@apache.org
Subject svn commit: r745776 - /commons/sandbox/monitoring/branches/modules/reporting/src/main/java/org/apache/commons/monitoring/reporting/Selector.java
Date Thu, 19 Feb 2009 08:23:14 GMT
Author: nicolas
Date: Thu Feb 19 08:23:13 2009
New Revision: 745776

URL: http://svn.apache.org/viewvc?rev=745776&view=rev
Log:
fix NullPointer

Modified:
    commons/sandbox/monitoring/branches/modules/reporting/src/main/java/org/apache/commons/monitoring/reporting/Selector.java

Modified: commons/sandbox/monitoring/branches/modules/reporting/src/main/java/org/apache/commons/monitoring/reporting/Selector.java
URL: http://svn.apache.org/viewvc/commons/sandbox/monitoring/branches/modules/reporting/src/main/java/org/apache/commons/monitoring/reporting/Selector.java?rev=745776&r1=745775&r2=745776&view=diff
==============================================================================
--- commons/sandbox/monitoring/branches/modules/reporting/src/main/java/org/apache/commons/monitoring/reporting/Selector.java
(original)
+++ commons/sandbox/monitoring/branches/modules/reporting/src/main/java/org/apache/commons/monitoring/reporting/Selector.java
Thu Feb 19 08:23:13 2009
@@ -78,6 +78,10 @@
     public double getValue( Repository repository )
     {
         Metric metric = repository.getMonitor( name, category, subsystem ).getMetric( role
);
+        if ( metric == null )
+        {
+            return Double.NaN;
+        }
         double d = value.value( metric );
         return d;
     }



Mime
View raw message