← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 2405: Bug Fixed: giving exeception when data is null for selected orgunit

 

------------------------------------------------------------
revno: 2405
committer: Bharath <chbharathk@xxxxxxxxx>
branch nick: trunk
timestamp: Thu 2010-10-21 17:27:08 +0530
message:
  Bug Fixed: giving exeception when data is null for selected orgunit
modified:
  dhis-2/pom.xml
  local/in/dhis-web-dashboard/src/main/java/org/hisp/dhis/dashboard/ga/action/charts/GenerateChartDataAction.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/pom.xml'
--- dhis-2/pom.xml	2010-09-27 07:07:55 +0000
+++ dhis-2/pom.xml	2010-10-21 11:57:08 +0000
@@ -260,6 +260,7 @@
         <artifactId>spring-context</artifactId>
         <version>${spring.version}</version>
       </dependency>
+	  
       <dependency>
         <groupId>org.springframework</groupId>
         <artifactId>spring-core</artifactId>

=== modified file 'local/in/dhis-web-dashboard/src/main/java/org/hisp/dhis/dashboard/ga/action/charts/GenerateChartDataAction.java'
--- local/in/dhis-web-dashboard/src/main/java/org/hisp/dhis/dashboard/ga/action/charts/GenerateChartDataAction.java	2010-09-23 13:16:55 +0000
+++ local/in/dhis-web-dashboard/src/main/java/org/hisp/dhis/dashboard/ga/action/charts/GenerateChartDataAction.java	2010-10-21 11:57:08 +0000
@@ -915,7 +915,7 @@
                             if( aggDataCB == null )
                             {
                                 DataValue dv1 = dataValueService.getDataValue( selectedOrgUnit, dElement, p, decoc );
-                                if ( dv1 != null )
+                                if ( dv1 != null && dv1.getValue() != null )
                                     serviceValues[countForServiceList][countForPeriodList] = Double.parseDouble( dv1
                                         .getValue() );
                                 else
@@ -942,7 +942,7 @@
 
                                     double tempd = -1.0;
                                     DataValue dv1 = dataValueService.getDataValue( ou, dElement, p, decoc );
-                                    if ( dv1 != null )
+                                    if ( dv1 != null && dv1.getValue() != null )
                                         tempd = Double.parseDouble( dv1.getValue() );
                                     if ( tempd == -1.0 )
                                         tempd = 0.0;
@@ -1000,7 +1000,7 @@
                                 if ( aggDataCB == null )
                                 {
                                     DataValue dv1 = dataValueService.getDataValue( selectedOrgUnit, dElement, p, decoc1 );
-                                    if ( dv1 != null )
+                                    if ( dv1 != null && dv1.getValue() != null )
                                         aggDataValue = Double.parseDouble( dv1.getValue() );
                                     else
                                         aggDataValue = 0.0;
@@ -1024,7 +1024,7 @@
                                     if ( aggDataCB == null )
                                     {
                                         DataValue dv1 = dataValueService.getDataValue( ou, dElement, p, decoc1 );
-                                        if ( dv1 != null )
+                                        if ( dv1 != null && dv1.getValue() != null )
                                             tempd = Double.parseDouble( dv1.getValue() );
                                     }
                                     else
@@ -1440,7 +1440,7 @@
                                 for ( Period p1 : pList )
                                 {
                                     DataValue dv1 = dataValueService.getDataValue( childOrgUnit, dElement, p1, decoc );
-                                    if ( dv1 != null )
+                                    if ( dv1 != null && dv1.getValue() != null )
                                         tempAggValue += Double.parseDouble( dv1.getValue() );
                                 }
                                 serviceValues[countForServiceList][countForChildOrgUnitList] = tempAggValue;
@@ -1470,7 +1470,7 @@
                                     for ( Period p1 : pList )
                                     {
                                         DataValue dv1 = dataValueService.getDataValue( ou, dElement, p1, decoc );
-                                        if ( dv1 != null )
+                                        if ( dv1 != null && dv1.getValue() != null )
                                             tempAggValue += Double.parseDouble( dv1.getValue() );
                                     }
                                     tempd = tempAggValue;
@@ -1515,7 +1515,7 @@
                                     {
                                         DataValue dv1 = dataValueService.getDataValue( childOrgUnit, dElement, p1,
                                             decoc1 );
-                                        if ( dv1 != null )
+                                        if ( dv1 != null && dv1.getValue() != null )
                                             tempAggValue += Double.parseDouble( dv1.getValue() );
                                     }
                                     aggDataValue = tempAggValue;
@@ -1545,7 +1545,7 @@
                                         for ( Period p1 : pList )
                                         {
                                             DataValue dv1 = dataValueService.getDataValue( ou, dElement, p1, decoc1 );
-                                            if ( dv1 != null )
+                                            if ( dv1 != null && dv1.getValue() != null )
                                                 tempAggValue += Double.parseDouble( dv1.getValue() );
                                         }
                                         tempd = tempAggValue;