From f1c18e546e0eb21b79800518c53e56d0319e0ea5 Mon Sep 17 00:00:00 2001 From: Alvaro Vega Date: Mon, 10 Jun 2024 09:35:33 +0200 Subject: [PATCH] fix check geo null --- .../telefonica/iot/cygnus/backends/arcgis/model/Feature.java | 2 +- .../telefonica/iot/cygnus/sinks/NGSIArcgisFeatureTableSink.java | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/cygnus-common/src/main/java/com/telefonica/iot/cygnus/backends/arcgis/model/Feature.java b/cygnus-common/src/main/java/com/telefonica/iot/cygnus/backends/arcgis/model/Feature.java index 266838d0a..559a110a5 100644 --- a/cygnus-common/src/main/java/com/telefonica/iot/cygnus/backends/arcgis/model/Feature.java +++ b/cygnus-common/src/main/java/com/telefonica/iot/cygnus/backends/arcgis/model/Feature.java @@ -276,7 +276,7 @@ public JsonObject toJson() { JsonObject resultJSON = new JsonObject(); Geometry geo = this.getGeometry(); - if (geo) { + if (geo != null) { resultJSON.add(GEOMETRY_TAG, geo.toJSON()); } 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 4f4e46226..8a637b586 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 @@ -596,6 +596,7 @@ protected void jsonElementToFeatureAttr(String attrName, String attrType, JsonEl } else { LOGGER.warn("Invalid geo:json type, only points allowed: " + location.toString()); + feature.setGeometry(null); } } catch (Exception e) { LOGGER.error("Invalid geo:json format, (sikipped): " + attrValue.toString() + " - Error: "