tdwright / contabs

Simple yet flexible tables for console apps.
MIT License
54 stars 20 forks source link

Handle nulls in a more dignified manner #40

Closed tdwright closed 6 years ago

tdwright commented 6 years ago

It seems to me that the expected behaviour for null values should be an empty string, not a NullReferenceException as is currently the case.

var Data = DemoDataProvider.ListOfDemoData();
Data[0].StringCol = null;
var table = Table<DemoDataType>.Create(Data);
Console.WriteLine(table.ToString());

This should be rendered like:

+-----------+--------+
| StringCol | IntCol |
+-----------+--------+
|           | 2      |
| Dogs      | 1      |
| Chickens  | 3      |
+-----------+--------+

This will help if/when we start to tackle anonymous objects (e.g. #35).

MichaelStedman commented 6 years ago

I read your recent blog about "Attracting contributors to ConTabs".

Would you like me to look at this issue?

tdwright commented 6 years ago

Hi @MichaelStedman - great to have you here. If you'd like to tackle this one, it would be appreciated.

tdwright commented 6 years ago

Thanks @MichaelStedman! This will be included in the next release, which should be this weekend.