Skip to content

Commit

Permalink
Merge pull request #2414 from telefonicaid/fix/check_server_features_…
Browse files Browse the repository at this point in the history
…before_access

check serverFeatures before access it
  • Loading branch information
fgalan authored Sep 24, 2024
2 parents 7b4b014 + e08fc16 commit f1134af
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 12 deletions.
1 change: 1 addition & 0 deletions CHANGES_NEXT_RELEASE
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
- [cygnus-ngsi][arcgis] Fix CygnusRuntimeError due to Cannot invoke "java.util.List.size()" because "serverFeatures" is null (#2413)
Original file line number Diff line number Diff line change
Expand Up @@ -387,19 +387,21 @@ protected void splitFeatureListIfExists(List<Feature> featureArray,
}

int i = 0;
while (!found && i < serverFeatures.size()) {
Feature serverFeature = serverFeatures.get(i);
String serverFeatureId = null;
if ( serverFeature.getAttributes().containsKey(uniqueField)) {
serverFeatureId = serverFeature.getAttributes().get(uniqueField).toString();
}
if (featureId.equalsIgnoreCase(serverFeatureId)) {
found = true;
Integer oid = serverFeature.getObjectId();
feature.setObjectId(oid);
existentFeatures.add(feature);
if (serverFeatures != null) {
while (!found && i < serverFeatures.size()) {
Feature serverFeature = serverFeatures.get(i);
String serverFeatureId = null;
if ( serverFeature.getAttributes().containsKey(uniqueField)) {
serverFeatureId = serverFeature.getAttributes().get(uniqueField).toString();
}
if (featureId.equalsIgnoreCase(serverFeatureId)) {
found = true;
Integer oid = serverFeature.getObjectId();
feature.setObjectId(oid);
existentFeatures.add(feature);
}
i++;
}
i++;
}

if (!found) {
Expand Down

0 comments on commit f1134af

Please sign in to comment.