← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 12214: Nullpointer vulnerability

 

------------------------------------------------------------
revno: 12214
committer: Lars Helge Øverland <larshelge@xxxxxxxxx>
branch nick: dhis2
timestamp: Mon 2013-09-23 17:07:22 +0200
message:
  Nullpointer vulnerability
modified:
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/mapping/MapView.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/mapping/MapView.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/mapping/MapView.java	2013-09-17 16:22:09 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/mapping/MapView.java	2013-09-23 15:07:22 +0000
@@ -164,7 +164,8 @@
     @Override
     public String getName()
     {
-        return indicators != null ? indicators.get( 0 ).getName() : dataElements != null ? dataElements.get( 0 ).getName() : uid;
+        return ( indicators != null && !indicators.isEmpty() ) ? indicators.get( 0 ).getName() : 
+            ( dataElements != null && !dataElements.isEmpty() ) ? dataElements.get( 0 ).getName() : uid;
     }
 
     @JsonProperty