← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 13860: csd: minor NPE checks

 

------------------------------------------------------------
revno: 13860
committer: Morten Olav Hansen <mortenoh@xxxxxxxxx>
branch nick: dhis2
timestamp: Mon 2014-01-27 16:39:28 +0700
message:
  csd: minor NPE checks
modified:
  dhis-2/dhis-web/dhis-web-ohie/src/main/java/org/hisp/dhis/web/ohie/csd/webapi/CsdController.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-ohie/src/main/java/org/hisp/dhis/web/ohie/csd/webapi/CsdController.java'
--- dhis-2/dhis-web/dhis-web-ohie/src/main/java/org/hisp/dhis/web/ohie/csd/webapi/CsdController.java	2014-01-27 07:48:42 +0000
+++ dhis-2/dhis-web/dhis-web-ohie/src/main/java/org/hisp/dhis/web/ohie/csd/webapi/CsdController.java	2014-01-27 09:39:28 +0000
@@ -287,12 +287,23 @@
 
             for ( OrganisationUnitGroup organisationUnitGroup : organisationUnit.getGroups() )
             {
-                if ( organisationUnitGroup.getGroupSet().getName().equals( FACILITY_STATUS_DISCRIMINATOR ) )
+                if ( organisationUnitGroup == null )
+                {
+                    continue;
+                }
+
+                if ( organisationUnitGroup.getGroupSet() != null &&
+                    organisationUnitGroup.getGroupSet().getName().equals( FACILITY_STATUS_DISCRIMINATOR ) )
                 {
                     facilityStatus = organisationUnitGroup.getCode();
                     continue;
                 }
 
+                if ( organisationUnitGroup.getCode() == null )
+                {
+                    continue;
+                }
+
                 CodedType codedType = new CodedType();
                 codedType.setCode( organisationUnitGroup.getCode() );