← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 12185: only add programStageInstance if it was successfully created

 

------------------------------------------------------------
revno: 12185
committer: Morten Olav Hansen <mortenoh@xxxxxxxxx>
branch nick: dhis2
timestamp: Fri 2013-09-20 11:01:03 +0200
message:
  only add programStageInstance if it was successfully created
modified:
  dhis-2/dhis-services/dhis-service-patient/src/main/java/org/hisp/dhis/program/DefaultProgramInstanceService.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/DefaultProgramInstanceService.java'
--- dhis-2/dhis-services/dhis-service-patient/src/main/java/org/hisp/dhis/program/DefaultProgramInstanceService.java	2013-09-19 08:26:17 +0000
+++ dhis-2/dhis-services/dhis-service-patient/src/main/java/org/hisp/dhis/program/DefaultProgramInstanceService.java	2013-09-20 09:01:03 +0000
@@ -664,7 +664,11 @@
             {
                 ProgramStageInstance programStageInstance = generateEvent( programInstance, programStage,
                     enrollmentDate, dateOfIncident, organisationUnit );
-                programStageInstanceService.addProgramStageInstance( programStageInstance );
+
+                if ( programStageInstance != null )
+                {
+                    programStageInstanceService.addProgramStageInstance( programStageInstance );
+                }
             }
         }