diff --git a/CHANGES_NEXT_RELEASE b/CHANGES_NEXT_RELEASE index 8b1378917..20e4f8fd8 100644 --- a/CHANGES_NEXT_RELEASE +++ b/CHANGES_NEXT_RELEASE @@ -1 +1 @@ - +- [cygnus-arcgis] Insert null attribute as is in feature table (#2376) diff --git a/cygnus-ngsi/src/main/java/com/telefonica/iot/cygnus/sinks/NGSIArcgisFeatureTableSink.java b/cygnus-ngsi/src/main/java/com/telefonica/iot/cygnus/sinks/NGSIArcgisFeatureTableSink.java index 0b7944d57..810eb6551 100644 --- a/cygnus-ngsi/src/main/java/com/telefonica/iot/cygnus/sinks/NGSIArcgisFeatureTableSink.java +++ b/cygnus-ngsi/src/main/java/com/telefonica/iot/cygnus/sinks/NGSIArcgisFeatureTableSink.java @@ -631,11 +631,17 @@ 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 LOGGER.warn( "[NGSIArcgisAggregator] Unquoted String attribute: " + attrName + ":" + attrValue); - String strValue = URLDecoder.decode(attrValue.toString()); - feature.addAttribute(attrName, strValue); + // If all fails, insert as String, except if null + if (attrValue != null) { + String strValue = URLDecoder.decode(attrValue.toString()); + feature.addAttribute(attrName, strValue); + } else { + // Insert null as is + feature.addAttribute(attrName, attrValue); + } + } } }