42BV / CSVeed

Light-weight, easy-to-use Java-based CSV utility
Apache License 2.0
100 stars 22 forks source link

NPE in writeCell #53

Open j256 opened 9 years ago

j256 commented 9 years ago

So I suspect that this is because the writer is not expecting a cell to be null. At the very least a better exception should be thrown that explains that field XXX was null.

java.lang.NullPointerException: null at org.csveed.row.RowWriterImpl.writeCell(RowWriterImpl.java:107) ~[csveed-0.4.0.jar:na] at org.csveed.row.RowWriterImpl.writeCells(RowWriterImpl.java:87) ~[csveed-0.4.0.jar:na] at org.csveed.row.RowWriterImpl.writeRow(RowWriterImpl.java:57) ~[csveed-0.4.0.jar:na]

What I seem to be missing is null handling when writing bean fields. Maybe a setter which says outputBlankCellForNull(boolean) or something?

j256 commented 9 years ago

Wow, this is frustrating. Not sure what CSVeed is expecting. Do I really need to write custom converters for all of my fields just to handle nulls? Geez. Ok.