From 23dc0247f22a2592a371fc55b34758aa97f0e4d9 Mon Sep 17 00:00:00 2001 From: Alvaro Vega Date: Thu, 29 Feb 2024 14:53:23 +0100 Subject: [PATCH 1/2] check attributes containsKey before get it --- .../backends/arcgis/restutils/ArcgisFeatureTable.java | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) 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(); From 5f0ebd452cabfb7c917a211e92388271bbcd1c33 Mon Sep 17 00:00:00 2001 From: Alvaro Vega Date: Thu, 29 Feb 2024 14:54:49 +0100 Subject: [PATCH 2/2] update CNR --- CHANGES_NEXT_RELEASE | 1 + 1 file changed, 1 insertion(+) 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)