Hi,
I don't know if this forum is the correct place to post bug reports or patches (haven't seen a project in TalendForge's JIRA specifically for the SDI plugin), please inform me if this should go somewhere else.
I've encountered an issue while using the sOgrInput component in a job, when trying to read a MapInfo TAB file containing a NULL geometry. The job fails with a NullPointerException when reading the offending record. NULL geometries are a admittedly an uncommon and odd occurrence, but in this case I have no control over the TAB file contents.
I've been able to work around the problem and pass a NULL value by modifying the component's sOgrInput_begin.javajet code, to check when the call to org.gdal.ogr.Feature.GetGeometryRef() returns null and pass a null value instead of trying to invoke the ExportToWkt() method on the null ogrGeometry (and skip assigning the SRID as well).
Please find a patch with the fix below.
Thanks!
Etienne
----------------------------------------
.../components/sOgrInput/sOgrInput_begin.javajet | 11 +++++++----
1 file changed, 7 insertions(+), 4 deletions(-)
diff --git a/org.talend.sdi.designer.components.sandbox/components/sOgrInput/sOgrInput_begin.javajet b/org.talend.sdi.designer.components.sandbox/components/sOgrInput/sOgrInput_begin.javajet
index 9a23ea5..c71c259 100755
--- a/org.talend.sdi.designer.components.sandbox/components/sOgrInput/sOgrInput_begin.javajet
+++ b/org.talend.sdi.designer.components.sandbox/components/sOgrInput/sOgrInput_begin.javajet
@@ -169,10 +169,13 @@ while ((poFeature_<%=cid %> = poLayer_<%=cid %>.GetNextFeature()) != null) {