From 79a9e8a9e932bde32fade26d77f3daf5398a9920 Mon Sep 17 00:00:00 2001 From: Alvaro Vega Date: Mon, 10 Jun 2024 09:27:39 +0200 Subject: [PATCH] check if geometry before add to JSON --- .../telefonica/iot/cygnus/backends/arcgis/model/Feature.java | 5 ++++- 1 file changed, 4 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 8e35c0cb6..266838d0a 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 @@ -275,7 +275,10 @@ public void setObjectId(Integer objectId) throws ArcgisException { public JsonObject toJson() { JsonObject resultJSON = new JsonObject(); - resultJSON.add(GEOMETRY_TAG, this.getGeometry().toJSON()); + Geometry geo = this.getGeometry(); + if (geo) { + resultJSON.add(GEOMETRY_TAG, geo.toJSON()); + } JsonObject attributes = new JsonObject(); for (Map.Entry attribute : this.attributes.entrySet()) {