← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 2733: Fixed nullpointer prone code

 

------------------------------------------------------------
revno: 2733
committer: Lars Helge Overland <larshelge@xxxxxxxxx>
branch nick: dhis2
timestamp: Mon 2011-01-24 20:52:30 +0100
message:
  Fixed nullpointer prone code
modified:
  dhis-2/dhis-services/dhis-service-mapping/src/main/java/org/hisp/dhis/mapping/MapViewDeletionHandler.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-mapping/src/main/java/org/hisp/dhis/mapping/MapViewDeletionHandler.java'
--- dhis-2/dhis-services/dhis-service-mapping/src/main/java/org/hisp/dhis/mapping/MapViewDeletionHandler.java	2010-11-15 16:26:51 +0000
+++ dhis-2/dhis-services/dhis-service-mapping/src/main/java/org/hisp/dhis/mapping/MapViewDeletionHandler.java	2011-01-24 19:52:30 +0000
@@ -79,7 +79,7 @@
     {
         for ( MapView mapView : mappingService.getAllMapViews() )
         {
-            if ( mapView.getIndicatorGroup().equals( indicatorGroup ) )
+            if ( mapView.getIndicatorGroup() != null && mapView.getIndicatorGroup().equals( indicatorGroup ) )
             {
                 mappingService.deleteMapView( mapView );
             }
@@ -91,7 +91,7 @@
     {
         for ( MapView mapView : mappingService.getAllMapViews() )
         {
-            if ( mapView.getIndicator().equals( indicator ) )
+            if ( mapView.getIndicator() != null && mapView.getIndicator().equals( indicator ) )
             {
                 mappingService.deleteMapView( mapView );
             }
@@ -103,7 +103,7 @@
     {
         for ( MapView mapView : mappingService.getAllMapViews() )
         {
-            if ( mapView.getMapLegendSet() != null && mapView.getMapLegendSet().equals( mapLegendSet ) ) // MapLegendSet is optional
+            if ( mapView.getMapLegendSet() != null && mapView.getMapLegendSet().equals( mapLegendSet ) )
             {
                 mappingService.deleteMapView( mapView );
             }