atolcd / pentaho-gis-plugins

🗺 GIS plugins for Pentaho Data Integration
https://www.atolcd.com/expertise/solutions-geographiques-open-source-sig
48 stars 20 forks source link

Null pointer exception when property value is null or empty object in GeoJSON file #22

Open dlutz2 opened 4 years ago

dlutz2 commented 4 years ago

The plugin throws a null pointer error when it encounters a GeoJSON property which is null or an empty object:

"properties": {
  "property": null
}

or

"properties": {
  "property": {}
}

The exception as seen in the Kettle log:

2020/07/20 01:04:24 - GIS File input.0 - ERROR (version 8.3.0.0-371, build 8.3.0.0-371 from 2019-06-11 11.09.08 by buildguy) : Unexpected error
2020/07/20 01:04:24 - GIS File input.0 - ERROR (version 8.3.0.0-371, build 8.3.0.0-371 from 2019-06-11 11.09.08 by buildguy) : java.lang.NullPointerException
2020/07/20 01:04:24 - GIS File input.0 -    at com.atolcd.pentaho.di.gis.io.features.FeatureConverter.getRowMeta(FeatureConverter.java:149)
2020/07/20 01:04:24 - GIS File input.0 -    at com.atolcd.pentaho.di.trans.steps.gisfileinput.GisFileInputMeta.getFields(GisFileInputMeta.java:222)
2020/07/20 01:04:24 - GIS File input.0 -    at com.atolcd.pentaho.di.trans.steps.gisfileinput.GisFileInput.processRow(GisFileInput.java:65)
2020/07/20 01:04:24 - GIS File input.0 -    at org.pentaho.di.trans.step.RunThread.run(RunThread.java:62)
2020/07/20 01:04:24 - GIS File input.0 -    at java.lang.Thread.run(Thread.java:748)

Using Kettle 8.3.0.0-371 and GIS Plugin V1.3.0

dlutz2 commented 4 years ago

Looked at this further, the null pointer exception will also occur if a property is an array or a (not-null) object