ConsoleTables icon indicating copy to clipboard operation
ConsoleTables copied to clipboard

Table.Write() with alternative format throws null ref

Open georgeamason opened this issue 1 year ago • 3 comments

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)

georgeamason avatar Aug 14 '23 23:08 georgeamason

Seeing the same thing:

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

kieranbenton avatar Sep 19 '23 11:09 kieranbenton

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

georgeamason avatar Oct 09 '23 21:10 georgeamason

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.<<<Main>$>g__Print|3>d.MoveNext() in .....\Program.cs:line 89 at System.Threading.Tasks.Task.<>c.<ThrowAsync>b__128_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

Nobody84 avatar Mar 18 '24 13:03 Nobody84