← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 10590: Fixed potential nullpointer access in pivot

 

------------------------------------------------------------
revno: 10590
committer: Lars Helge Øverland <larshelge@xxxxxxxxx>
branch nick: dhis2
timestamp: Tue 2013-04-16 20:22:00 +0200
message:
  Fixed potential nullpointer access in pivot
modified:
  dhis-2/dhis-web/dhis-web-pivot/src/main/java/org/hisp/dhis/pivot/action/GetOrganisationUnitChildrenAction.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-web/dhis-web-pivot/src/main/java/org/hisp/dhis/pivot/action/GetOrganisationUnitChildrenAction.java'
--- dhis-2/dhis-web/dhis-web-pivot/src/main/java/org/hisp/dhis/pivot/action/GetOrganisationUnitChildrenAction.java	2013-01-17 16:06:38 +0000
+++ dhis-2/dhis-web/dhis-web-pivot/src/main/java/org/hisp/dhis/pivot/action/GetOrganisationUnitChildrenAction.java	2013-04-16 18:22:00 +0000
@@ -86,10 +86,10 @@
     {
         OrganisationUnit unit = organisationUnitService.getOrganisationUnit( node );
         
-        int level = organisationUnitService.getLevelOfOrganisationUnit( unit.getId() ) + 1;
-        
         if ( unit != null )
         {
+            int level = organisationUnitService.getLevelOfOrganisationUnit( unit.getId() ) + 1;
+            
             units = new ArrayList<OrganisationUnit>( unit.getChildren() );
             
             for ( OrganisationUnit organisationUnit : units )