From: <sc...@hy...> - 2009-01-14 22:38:38
|
Author: scottmf Date: 2009-01-14 14:38:33 -0800 (Wed, 14 Jan 2009) New Revision: 12265 URL: http://svn.hyperic.org/?view=rev&root=Hyperic+HQ&revision=12265 Modified: trunk/src/org/hyperic/hq/bizapp/server/session/MeasurementBossEJBImpl.java trunk/src/org/hyperic/hq/bizapp/server/session/MetricSessionEJB.java Log: fixed null point exception when viewing PSS resource hub / indicator pages Modified: trunk/src/org/hyperic/hq/bizapp/server/session/MeasurementBossEJBImpl.java =================================================================== --- trunk/src/org/hyperic/hq/bizapp/server/session/MeasurementBossEJBImpl.java 2009-01-14 09:20:50 UTC (rev 12264) +++ trunk/src/org/hyperic/hq/bizapp/server/session/MeasurementBossEJBImpl.java 2009-01-14 22:38:33 UTC (rev 12265) @@ -1938,8 +1938,7 @@ "Requested group (" + entId + ") is not a compatible type"); } - } else - if (entId.isApplication()) { + } else if (entId.isApplication()) { AppdefEntityValue aev = new AppdefEntityValue(entId, subject); resources = aev.getAssociatedServices(typeId, PageControl.PAGE_ALL); if (typeId != null) { @@ -1971,8 +1970,8 @@ } AppdefEntityID[] resourceArray = toAppdefEntityIDArray(resources); - double[] data = getAvailability(subject, resourceArray, null, null); - + double[] data = getAvailability(subject, resourceArray); + // Availability counts **this calls getLiveMeasurement int availCnt = 0; int unavailCnt = 0; Modified: trunk/src/org/hyperic/hq/bizapp/server/session/MetricSessionEJB.java =================================================================== --- trunk/src/org/hyperic/hq/bizapp/server/session/MetricSessionEJB.java 2009-01-14 09:20:50 UTC (rev 12264) +++ trunk/src/org/hyperic/hq/bizapp/server/session/MetricSessionEJB.java 2009-01-14 22:38:33 UTC (rev 12265) @@ -561,9 +561,11 @@ if (id == null) { continue; } - Measurement m = - mMan.getAvailabilityMeasurement(rMan.findResource(id)); - rtn.put(id, m.getId()); + final Resource resource = rMan.findResource(id); + Measurement m = mMan.getAvailabilityMeasurement(resource); + if (m != null) { + rtn.put(id, m.getId()); + } } return rtn; } |