dhis2-devs team mailing list archive
-
dhis2-devs team
-
Mailing list archive
-
Message #35552
[Branch ~dhis2-devs-core/dhis2/trunk] Rev 18198: NPE check in AbstractEventService
------------------------------------------------------------
revno: 18198
committer: Morten Olav Hansen <mortenoh@xxxxxxxxx>
branch nick: dhis2
timestamp: Mon 2015-02-09 15:53:23 +0700
message:
NPE check in AbstractEventService
modified:
dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/events/event/AbstractEventService.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-dxf2/src/main/java/org/hisp/dhis/dxf2/events/event/AbstractEventService.java'
--- dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/events/event/AbstractEventService.java 2015-01-17 07:41:26 +0000
+++ dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/events/event/AbstractEventService.java 2015-02-09 08:53:23 +0000
@@ -627,7 +627,12 @@
event.setEventDate( DateUtils.getLongDateString( programStageInstance.getExecutionDate() ) );
event.setDueDate( DateUtils.getLongDateString( programStageInstance.getDueDate() ) );
event.setStoredBy( programStageInstance.getCompletedUser() );
- event.setOrgUnit( programStageInstance.getOrganisationUnit().getUid() );
+
+ if ( programStageInstance.getOrganisationUnit() != null )
+ {
+ event.setOrgUnit( programStageInstance.getOrganisationUnit().getUid() );
+ }
+
event.setProgram( programStageInstance.getProgramInstance().getProgram().getUid() );
event.setEnrollment( programStageInstance.getProgramInstance().getUid() );
event.setProgramStage( programStageInstance.getProgramStage().getUid() );