dhis2-devs team mailing list archive
-
dhis2-devs team
-
Mailing list archive
-
Message #33224
[Branch ~dhis2-devs-core/dhis2/trunk] Rev 16954: check for valid orgUnit in event controller
------------------------------------------------------------
revno: 16954
committer: Morten Olav Hansen <mortenoh@xxxxxxxxx>
branch nick: dhis2
timestamp: Sat 2014-10-04 09:37:01 +0700
message:
check for valid orgUnit in event controller
modified:
dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/webapi/controller/event/EventController.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-api/src/main/java/org/hisp/dhis/webapi/controller/event/EventController.java'
--- dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/webapi/controller/event/EventController.java 2014-10-04 02:30:53 +0000
+++ dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/webapi/controller/event/EventController.java 2014-10-04 02:37:01 +0000
@@ -163,6 +163,12 @@
if ( orgUnit != null )
{
rootOrganisationUnit = manager.get( OrganisationUnit.class, orgUnit );
+
+ if ( rootOrganisationUnit == null )
+ {
+ ContextUtils.conflictResponse( response, "Invalid orgUnit ID." );
+ return null;
+ }
}
if ( rootOrganisationUnit != null )