← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 19795: IdentifiableObjectImporter, nullpointer checks for attribute values

 

------------------------------------------------------------
revno: 19795
committer: Lars Helge Overland <larshelge@xxxxxxxxx>
branch nick: dhis2
timestamp: Wed 2015-08-19 10:42:27 -0400
message:
  IdentifiableObjectImporter, nullpointer checks for attribute values
modified:
  dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/metadata/importers/DefaultIdentifiableObjectImporter.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/metadata/importers/DefaultIdentifiableObjectImporter.java'
--- dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/metadata/importers/DefaultIdentifiableObjectImporter.java	2015-08-18 06:28:46 +0000
+++ dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/metadata/importers/DefaultIdentifiableObjectImporter.java	2015-08-19 14:42:27 +0000
@@ -1126,7 +1126,7 @@
             {
                 attributeValues = ReflectionUtils.invokeGetterMethod( "attributeValues", object );
 
-                if ( attributeValues.size() > 0 )
+                if ( attributeValues != null && attributeValues.size() > 0 )
                 {
                     ReflectionUtils.invokeSetterMethod( "attributeValues", object, Sets.newHashSet() );
                 }
@@ -1187,7 +1187,7 @@
 
         private void saveAttributeValues( T object, Collection<AttributeValue> attributeValues )
         {
-            if ( attributeValues.size() > 0 )
+            if ( attributeValues != null && attributeValues.size() > 0 )
             {
                 for ( AttributeValue attributeValue : attributeValues )
                 {