← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 6532: Minor fix

 

------------------------------------------------------------
revno: 6532
committer: Lars Helge Overland <larshelge@xxxxxxxxx>
branch nick: dhis2
timestamp: Tue 2012-04-10 12:10:21 +0200
message:
  Minor fix
modified:
  dhis-2/dhis-services/dhis-service-patient/src/main/java/org/hisp/dhis/program/DefaultProgramStageInstanceService.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-patient/src/main/java/org/hisp/dhis/program/DefaultProgramStageInstanceService.java'
--- dhis-2/dhis-services/dhis-service-patient/src/main/java/org/hisp/dhis/program/DefaultProgramStageInstanceService.java	2012-03-23 03:46:08 +0000
+++ dhis-2/dhis-services/dhis-service-patient/src/main/java/org/hisp/dhis/program/DefaultProgramStageInstanceService.java	2012-04-10 10:10:21 +0000
@@ -381,7 +381,16 @@
                 
                 if ( !anonymous )
                 {
-                    grid.addValue( programStageInstance.getProgramInstance().getPatient().getId() );
+                    ProgramInstance programInstance = programStageInstance.getProgramInstance();
+                    
+                    if ( programInstance != null && programInstance.getPatient() != null )
+                    {
+                        grid.addValue( programInstance.getPatient().getId() );
+                    }
+                    else
+                    {
+                        grid.addValue( "" );
+                    }
                 }
             }
         }