Skip to content

Commit

Permalink
check attributes containsKey before get it
Browse files Browse the repository at this point in the history
  • Loading branch information
AlvaroVega committed Feb 29, 2024
1 parent d16492b commit 23dc024
Showing 1 changed file with 8 additions and 3 deletions.
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 23dc024

Please sign in to comment.