xou/elixlsx

If I pass nil into column parameter the lib broke

danielscosta opened this issue · 3 comments

This code:
%Workbook{sheets: [%Sheet{name: "Posts", rows: [nil]}]} breaks the lib when I execute Elixlsx.write_to_memory("output.xlsx") on Elixlsx.Compiler.compinfo_from_rows.
That's behaviour expected?

Greetings. At first you didn't pass just a nil, it's a list with a single nil value. You rather should set rows to an empty list or should not pass it at all. That's literally not a problem with the library. Maybe we could return an :error or throw some kind of exception to be clear but not more than this.

Thanks for the answer.

You are welcome