Skip to content

Commit

Permalink
Merge pull request #2348 from telefonicaid/fix/check_contains_key_bef…
Browse files Browse the repository at this point in the history
…ore_get_uniqueField_from_attributes

Fix/check contains key before get unique field from attributes
  • Loading branch information
danielvillalbamota authored Feb 29, 2024
2 parents d16492b + 5f0ebd4 commit 2f2a0a1
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
1 change: 1 addition & 0 deletions CHANGES_NEXT_RELEASE
Original file line number Diff line number Diff line change
@@ -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)
Original file line number Diff line number Diff line change
Expand Up @@ -381,13 +381,18 @@ protected void splitFeatureListIfExists(List<Feature> 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();
Expand Down

0 comments on commit 2f2a0a1

Please sign in to comment.