Closed jasonab closed 11 years ago
I don't consider this an error, actually. Clojure-CSV is not in the business of serializing your objects; write-csv expects a sequence of strings for a row, not strings, numbers, nils, and anything else, that it must then have an opinion on how to write in the CSV file.
What you should do is write a function that you can map on your rows, and turn any nil entries into "" or "nil" or whatever you wish to happen with nil entries.
Agree with the sentiment, but in practice, every user if the library will end up writing a nil conversion function. fwiw, I tend to think it would be a good idea for this feature to be implemented, if only for the pragmatic reason of saving a little effort on behalf of 1000's of happy nil passing users.
Given a sequence that contains nil entries, needs-quote? throws NullPointerException:
java.lang.NullPointerException: null core.clj:228 clojure-csv.core/needs-quote? core.clj:244 clojure-csv.core/quote-and-escape core.clj:255 clojure-csv.core/quote-and-escape-row[fn]