khalidabuhakmeh / ConsoleTables

Print out a nicely formatted table in a console application C#
MIT License
944 stars 157 forks source link

Table.Write() with alternative format throws null ref #64

Open georgeamason opened 1 year ago

georgeamason commented 1 year ago

Setting the format inside the constructor of table.Write to Format.Alternative, causes a null reference exception to be thrown. Happening somewhere in ToStringAlternative() method

System.NullReferenceException: Object reference not set to an instance of an object.
   at ConsoleTables.ConsoleTable.ToStringAlternative()
   at ConsoleTables.ConsoleTable.Write(Format format)
kieranbenton commented 1 year ago

Seeing the same thing:

Error Message:
   System.NullReferenceException : Object reference not set to an instance of an object.
  Stack Trace:
     at ConsoleTables.ConsoleTable.ToStringAlternative()
georgeamason commented 11 months ago

https://github.com/khalidabuhakmeh/ConsoleTables/pull/67

Nobody84 commented 6 months ago

I'm using Release 2.6.1 and still got the error.

System.NullReferenceException HResult=0x80004003 Message=Object reference not set to an instance of an object. Source=ConsoleTables StackTrace: at ConsoleTables.ConsoleTable.ToStringAlternative() in /home/runner/work/ConsoleTables/ConsoleTables/src/ConsoleTables/ConsoleTable.cs:line 254 at Program.<>c__DisplayClass0_0.<<

$>gPrint|3>d.MoveNext() in .....\Program.cs:line 89 at System.Threading.Tasks.Task.<>c.b128_1(Object state) in System.Threading.Tasks\Task.cs:line 1936 at System.Threading.ThreadPoolWorkQueue.Dispatch() in System.Threading\ThreadPoolWorkQueue.cs:line 690 at System.Threading.PortableThreadPool.WorkerThread.WorkerThreadStart() in System.Threading\PortableThreadPool.cs:line 1328