← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 14784: NPE check

 

------------------------------------------------------------
revno: 14784
committer: Lars Helge Øverland <larshelge@xxxxxxxxx>
branch nick: dhis2
timestamp: Fri 2014-04-11 01:45:13 +0200
message:
  NPE check
modified:
  dhis-2/dhis-services/dhis-service-analytics/src/main/java/org/hisp/dhis/analytics/event/data/DefaultEventAnalyticsService.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-analytics/src/main/java/org/hisp/dhis/analytics/event/data/DefaultEventAnalyticsService.java'
--- dhis-2/dhis-services/dhis-service-analytics/src/main/java/org/hisp/dhis/analytics/event/data/DefaultEventAnalyticsService.java	2014-04-07 10:35:04 +0000
+++ dhis-2/dhis-services/dhis-service-analytics/src/main/java/org/hisp/dhis/analytics/event/data/DefaultEventAnalyticsService.java	2014-04-10 23:45:13 +0000
@@ -359,10 +359,13 @@
             }
         }
 
-        for ( NameableObject object : params.getDimensionOrFilter( ORGUNIT_DIM_ID ) )
+        if ( params.hasDimensionOrFilter( ORGUNIT_DIM_ID ) )
         {
-            OrganisationUnit unit = (OrganisationUnit) object;
-            unit.setLevel( organisationUnitService.getLevelOfOrganisationUnit( unit.getUid() ) );
+            for ( NameableObject object : params.getDimensionOrFilter( ORGUNIT_DIM_ID ) )
+            {
+                OrganisationUnit unit = (OrganisationUnit) object;
+                unit.setLevel( organisationUnitService.getLevelOfOrganisationUnit( unit.getUid() ) );
+            }
         }
 
         if ( asc != null )