NullPointerException on WFS ComplexGeoJsonWriter Link check

Description

On App-Schema MongoDB GeoJSON output request Geoserver throws a NullPointerException on WFS ComplexGeoJsonWriter class -> checkIfFeatureIsLinked method, due to null userData object (attributes parameter) in properties not being null safe checked before using its methods.

Stack trace:

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 2019-06-26 10:54:45,380 INFO [wfs.json] - about to encode JSON 2019-06-26 10:54:45,704 INFO [geoserver.servlets] - OutputStream was successfully aborted. 2019-06-26 10:54:45,704 ERROR [geoserver.ows] - java.lang.NullPointerException at org.geoserver.wfs.json.ComplexGeoJsonWriter.checkIfFeatureIsLinked(ComplexGeoJsonWriter.java:353) at org.geoserver.wfs.json.ComplexGeoJsonWriter.getLinkedFeatures(ComplexGeoJsonWriter.java:330) at org.geoserver.wfs.json.ComplexGeoJsonWriter.encodePropertiesByType(ComplexGeoJsonWriter.java:241) at org.geoserver.wfs.json.ComplexGeoJsonWriter.encodeProperties(ComplexGeoJsonWriter.java:204) at org.geoserver.wfs.json.ComplexGeoJsonWriter.encodeFeature(ComplexGeoJsonWriter.java:119) at org.geoserver.wfs.json.ComplexGeoJsonWriter.encodeFeatureCollection(ComplexGeoJsonWriter.java:97) at org.geoserver.wfs.json.ComplexGeoJsonWriter.write(ComplexGeoJsonWriter.java:88) at org.geoserver.wfs.json.GeoJSONGetFeatureResponse.writeFeatures(GeoJSONGetFeatureResponse.java:226) at org.geoserver.wfs.json.GeoJSONGetFeatureResponse.write(GeoJSONGetFeatureResponse.java:132) at org.geoserver.wfs.WFSGetFeatureOutputFormat.write(WFSGetFeatureOutputFormat.java:198) at org.geoserver.ows.Dispatcher.response(Dispatcher.java:1031)

Environment

None

Status

Assignee

Fernando Miño

Reporter

Fernando Miño

Triage

None

Fix versions

Affects versions

None

Priority

Medium
Configure