douglasg14b / BetterConsoleTables

Faster, colorable, more configurable, and more robust console colors & tables for C# console applications
GNU Lesser General Public License v3.0
92 stars 16 forks source link

Error no rows #22

Closed franklupo closed 2 years ago

franklupo commented 2 years ago

Hi, if you create a table without rows the ToString() method returns errors.

 var table = new Table(..);
....
table.AddRows(rows); // rows count = 0
var ret = table.ToString();

System.IndexOutOfRangeException
Index was outside the bounds of the array.
   at BetterConsoleTables.Table.ToString(Int32[] columnLengths)
   at BetterConsoleTables.Table.ToString()
douglasg14b commented 2 years ago

What library version are you on?

Additionally please post a full example.

franklupo commented 2 years ago

Version 1.1.2

franklupo commented 2 years ago

Example https://dotnetfiddle.net/deemYE

douglasg14b commented 2 years ago

This should now be fixed in v1.1.3

Please test in your environment, and close this issue if so.

douglasg14b commented 2 years ago

Closing this as there has been no reply and the problem should be resolved.