← Back to team overview

dhis2-devs team mailing list archive

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

 

------------------------------------------------------------
revno: 7723
committer: Lars Helge Overland <larshelge@xxxxxxxxx>
branch nick: dhis2
timestamp: Thu 2012-07-26 12:07:01 +0200
message:
  Minor
modified:
  dhis-2/dhis-web/dhis-web-validationrule/src/main/java/org/hisp/dhis/validationrule/action/dataanalysis/GetAnalysisAction.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-validationrule/src/main/java/org/hisp/dhis/validationrule/action/dataanalysis/GetAnalysisAction.java'
--- dhis-2/dhis-web/dhis-web-validationrule/src/main/java/org/hisp/dhis/validationrule/action/dataanalysis/GetAnalysisAction.java	2012-07-25 13:18:48 +0000
+++ dhis-2/dhis-web/dhis-web-validationrule/src/main/java/org/hisp/dhis/validationrule/action/dataanalysis/GetAnalysisAction.java	2012-07-26 10:07:01 +0000
@@ -184,13 +184,14 @@
         Set<DataElement> dataElements = new HashSet<DataElement>();
         Collection<Period> periods = null;
         OrganisationUnit unit = selectionTreeManager.getReloadedSelectedOrganisationUnit();
-
-        Collection<OrganisationUnit> orgUnits = organisationUnitService.getOrganisationUnitWithChildren( unit.getId() );
-        
+        Collection<OrganisationUnit> orgUnits = null;
+                
         // TODO filter periods with data element period type
         
-        if ( fromDate != null && toDate != null && dataSets != null )
+        if ( fromDate != null && toDate != null && dataSets != null && unit != null )
         {
+            orgUnits = organisationUnitService.getOrganisationUnitWithChildren( unit.getId() );
+            
             periods = periodService.getPeriodsBetweenDates( format.parseDate( fromDate ), format.parseDate( toDate ) );
 
             for ( String id : dataSets )