spatial4j
spatial4j copied to clipboard
NullPointerException in ShapeDeserializer when deserializing 3D coordinates
trafficstars
When deserializing geometries with 3D coordinates using the jackson ShapeDeserializer I get a NullPointerException (s. stack trace below). This is probably due to lines 47 and 60 in https://github.com/locationtech/spatial4j/blob/master/src/main/java/org/locationtech/spatial4j/io/jackson/ShapeDeserializer.java where you access the 4th element (element at index 3) of an array of size 3.
java.lang.NullPointerException: null
at org.locationtech.spatial4j.io.jackson.ShapeDeserializer.fillPoints(ShapeDeserializer.java:60)
at org.locationtech.spatial4j.io.jackson.ShapeDeserializer.read(ShapeDeserializer.java:167)
at org.locationtech.spatial4j.io.jackson.ShapeDeserializer.read(ShapeDeserializer.java:211)
at org.locationtech.spatial4j.io.jackson.ShapeDeserializer.deserialize(ShapeDeserializer.java:220)
at org.locationtech.spatial4j.io.jackson.GeometryDeserializer.deserialize(GeometryDeserializer.java:45)
Indeed. PR welcome :-)
Merge request #224 is merged, so I'll take the liberty and close this.