← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 21745: NPE check in ProgramTrackedEntityAttribute

 

------------------------------------------------------------
revno: 21745
committer: Morten Olav Hansen <mortenoh@xxxxxxxxx>
branch nick: dhis2
timestamp: Fri 2016-01-15 07:36:28 +0700
message:
  NPE check in ProgramTrackedEntityAttribute
modified:
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/program/ProgramTrackedEntityAttribute.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-api/src/main/java/org/hisp/dhis/program/ProgramTrackedEntityAttribute.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/program/ProgramTrackedEntityAttribute.java	2016-01-04 02:27:49 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/program/ProgramTrackedEntityAttribute.java	2016-01-15 00:36:28 +0000
@@ -122,7 +122,7 @@
     @JacksonXmlProperty( namespace = DxfNamespaces.DXF_2_0 )
     public ValueType getValueType()
     {
-        return attribute.getValueType();
+        return attribute != null ? attribute.getValueType() : null;
     }
 
     @Override
@@ -146,19 +146,19 @@
     @Override
     public String getDimensionItem()
     {
-        return program.getUid() + COMPOSITE_DIM_OBJECT_PLAIN_SEP + attribute.getUid();
+        return (program != null ? program.getUid() : "") + COMPOSITE_DIM_OBJECT_PLAIN_SEP + (attribute != null ? attribute.getUid() : "");
     }
 
     @Override
     public LegendSet getLegendSet()
     {
-        return attribute.getLegendSet();
+        return attribute != null ? attribute.getLegendSet() : null;
     }
 
     @Override
     public AggregationType getAggregationType()
     {
-        return attribute.getAggregationType();
+        return attribute != null ? attribute.getAggregationType() : null;
     }
 
     // -------------------------------------------------------------------------