Details
Description
The following GeoJSON caused a null pointer exception:
{
"features" : [
{
"geometry" :
,
"type" : "Feature",
"properties" :
}
],
"type" : "FeatureCollection"
}
The following method caused a null pointer exception:
public void onGeoJSONMessage(String message) {
try {
FeatureCollection pois = new FeatureJSON().readFeatureCollection(message);
FeatureIterator features = pois.features();
while(features.hasNext())
} catch(Exception e)
{ final String MESSAGE = "An exception occurred while parsing POI(s): "; log.error(MESSAGE, e); String alert = MESSAGE + e.toString(); new AlertMessage(AlertMessage.SEVERITY_ERROR, AlertMessage.ISSUE_TYPE_EXCEPTION, alert).publish(amqpTemplate); }}
Activity
Justin Deoliveira
made changes -
| Field | Original Value | New Value |
|---|---|---|
| Fix Version/s | 9.0-M0 [ 18643 ] | |
| Fix Version/s | 8.1 [ 18691 ] | |
| Resolution | Fixed [ 1 ] | |
| Assignee | Justin Deoliveira [ jdeolive ] | |
| Status | Open [ 1 ] | Resolved [ 5 ] |
poiEntity.setPoint((Point) feature.getDefaultGeometryProperty().getValue());
Ordering the JSON like the following avoids the null point exception:
{
"type": "FeatureCollection",
"features": [
{ "type": "Feature",
"geometry": {"type": "Point", "coordinates": [17.633333,59.85]},
"properties": {"name": "Station"}
}
]
}
The order of JSON object fields should not matter according to JSON specification.