← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 1800: Fixed bug - data-element-category-option-uuid-not-generated

 

------------------------------------------------------------
revno: 1800
committer: Lars Helge Oeverland <larshelge@xxxxxxxxx>
branch nick: trunk
timestamp: Thu 2010-04-22 13:50:55 +0200
message:
  Fixed bug - data-element-category-option-uuid-not-generated
modified:
  dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/dataelement/DefaultDataElementCategoryService.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-core/src/main/java/org/hisp/dhis/dataelement/DefaultDataElementCategoryService.java'
--- dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/dataelement/DefaultDataElementCategoryService.java	2010-04-12 21:23:33 +0000
+++ dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/dataelement/DefaultDataElementCategoryService.java	2010-04-22 11:50:55 +0000
@@ -98,7 +98,7 @@
 
     public int addDataElementCategory( DataElementCategory dataElementCategory )
     {
-	if ( dataElementCategory.getUuid() == null )
+	if ( dataElementCategory != null && dataElementCategory.getUuid() == null )
 	{
 	    dataElementCategory.setUuid( UUIdUtils.getUUId() );
 	}
@@ -150,6 +150,11 @@
 
     public int addDataElementCategoryOption( DataElementCategoryOption dataElementCategoryOption )
     {
+        if ( dataElementCategoryOption != null && dataElementCategoryOption.getUuid() == null )
+        {
+            dataElementCategoryOption.setUuid( UUIdUtils.getUUId() );
+        }
+        
         return dataElementCategoryOptionStore.save( dataElementCategoryOption );
     }