Skip to content

Commit

Permalink
check if geometry before add to JSON
Browse files Browse the repository at this point in the history
  • Loading branch information
AlvaroVega committed Jun 10, 2024
1 parent 8fe6e45 commit 79a9e8a
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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<String, Object> attribute : this.attributes.entrySet()) {
Expand Down

0 comments on commit 79a9e8a

Please sign in to comment.