dhis2-devs team mailing list archive
-
dhis2-devs team
-
Mailing list archive
-
Message #23571
[Branch ~dhis2-devs-core/dhis2/trunk] Rev 11472: PNG maps, preventing crash for unsupported map types
------------------------------------------------------------
revno: 11472
committer: Lars Helge Øverland <larshelge@xxxxxxxxx>
branch nick: dhis2
timestamp: Mon 2013-07-22 19:13:22 +0200
message:
PNG maps, preventing crash for unsupported map types
modified:
dhis-2/dhis-services/dhis-service-mapgeneration/src/main/java/org/hisp/dhis/mapgeneration/GeoToolsMapGenerationService.java
--
lp:dhis2
https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk
Your team DHIS 2 developers is subscribed to branch lp:dhis2.
To unsubscribe from this branch go to https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk/+edit-subscription
=== modified file 'dhis-2/dhis-services/dhis-service-mapgeneration/src/main/java/org/hisp/dhis/mapgeneration/GeoToolsMapGenerationService.java'
--- dhis-2/dhis-services/dhis-service-mapgeneration/src/main/java/org/hisp/dhis/mapgeneration/GeoToolsMapGenerationService.java 2013-07-18 17:16:22 +0000
+++ dhis-2/dhis-services/dhis-service-mapgeneration/src/main/java/org/hisp/dhis/mapgeneration/GeoToolsMapGenerationService.java 2013-07-22 17:13:22 +0000
@@ -104,7 +104,10 @@
{
InternalMapLayer mapLayer = buildSingleInternalMapLayer( mapView );
- internalMap.getLayers().add( mapLayer );
+ if ( mapLayer != null )
+ {
+ internalMap.getLayers().add( mapLayer );
+ }
}
if ( internalMap.getLayers().isEmpty() )
@@ -145,7 +148,10 @@
private InternalMapLayer buildSingleInternalMapLayer( MapView mapView )
{
- Assert.isTrue( mapView != null );
+ if ( mapView == null || mapView.getPeriod() == null || mapView.getParentOrganisationUnit() == null )
+ {
+ return null;
+ }
boolean isIndicator = MapView.VALUE_TYPE_INDICATOR.equals( mapView.getValueType() );
@@ -164,7 +170,7 @@
Grid grid = getDataGrid( mapView );
Collection<MapValue> mapValues = getMapValues( grid );
-
+
if ( mapValues.isEmpty() )
{
return null;