diff --git a/CHANGES_NEXT_RELEASE b/CHANGES_NEXT_RELEASE index 322890014..c1f10d9ee 100644 --- a/CHANGES_NEXT_RELEASE +++ b/CHANGES_NEXT_RELEASE @@ -1 +1,2 @@ [cygnus-common] Upgrade postgresql from 42.4.3 to 42.7.2 +[cygnus-common] [arcgis] Fix: check feature attributes containsKey before get it (#2347) diff --git a/cygnus-common/src/main/java/com/telefonica/iot/cygnus/backends/arcgis/restutils/ArcgisFeatureTable.java b/cygnus-common/src/main/java/com/telefonica/iot/cygnus/backends/arcgis/restutils/ArcgisFeatureTable.java index 1b67f6a8e..a7896cb0e 100644 --- a/cygnus-common/src/main/java/com/telefonica/iot/cygnus/backends/arcgis/restutils/ArcgisFeatureTable.java +++ b/cygnus-common/src/main/java/com/telefonica/iot/cygnus/backends/arcgis/restutils/ArcgisFeatureTable.java @@ -381,13 +381,18 @@ protected void splitFeatureListIfExists(List featureArray, for (Feature feature : featureArray) { boolean found = false; - String featureId = feature.getAttributes().get(uniqueField).toString(); + String featureId = null; + if (feature.getAttributes().containsKey(uniqueField)) { + featureId = feature.getAttributes().get(uniqueField).toString(); + } int i = 0; while (!found && i < serverFeatures.size()) { Feature serverFeature = serverFeatures.get(i); - String serverFeatureId = serverFeature.getAttributes().get(uniqueField).toString(); - + String serverFeatureId = null; + if ( serverFeature.getAttributes().containsKey(uniqueField)) { + serverFeatureId = serverFeature.getAttributes().get(uniqueField).toString(); + } if (featureId.equalsIgnoreCase(serverFeatureId)) { found = true; Integer oid = serverFeature.getObjectId();