Skip to content

Commit

Permalink
allow null attribute value for url
Browse files Browse the repository at this point in the history
  • Loading branch information
AlvaroVega committed Jun 4, 2024
1 parent 4bc2a3c commit c85f1d5
Showing 1 changed file with 10 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -631,11 +631,18 @@ protected void jsonElementToFeatureAttr(String attrName, String attrType, JsonEl
// Try to insert as Double
feature.addAttribute(attrName, Double.parseDouble(attrValue.toString()));
} catch (NumberFormatException e3) {
// If all fails, insert as String
// If all fails, insert as is
LOGGER.warn(
"[NGSIArcgisAggregator] Unquoted String attribute: " + attrName + ":" + attrValue);
String strValue = URLDecoder.decode(attrValue.toString());
feature.addAttribute(attrName, strValue);
try {
feature.addAttribute(attrName, attrValue);

} catch (Exception e) {
// If all fails, insert as String
String strValue = URLDecoder.decode(attrValue.toString());
feature.addAttribute(attrName, strValue);
}

}
}
}
Expand Down

0 comments on commit c85f1d5

Please sign in to comment.