Skip to content

Commit

Permalink
Merge pull request #2378 from telefonicaid/task/null_attribute_value_url
Browse files Browse the repository at this point in the history
check jsonNull value
  • Loading branch information
fgalan authored Jun 6, 2024
2 parents 7de533e + ed02d41 commit 9c9657c
Showing 1 changed file with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -634,12 +634,14 @@ protected void jsonElementToFeatureAttr(String attrName, String attrType, JsonEl
LOGGER.warn(
"[NGSIArcgisAggregator] Unquoted String attribute: " + attrName + ":" + attrValue);
// If all fails, insert as String, except if null
if (attrValue != null) {
if (attrValue != null &&
!attrValue.isJsonNull() &&
!attrValue.toString().equals("null") ) {
String strValue = URLDecoder.decode(attrValue.toString());
feature.addAttribute(attrName, strValue);
} else {
// Insert null as is
feature.addAttribute(attrName, attrValue);
// Insert null
feature.addAttribute(attrName, null);
}

}
Expand Down

0 comments on commit 9c9657c

Please sign in to comment.