Skip to content

Commit

Permalink
Fix crash for empty table headers or row
Browse files Browse the repository at this point in the history
  • Loading branch information
rgregg committed Feb 19, 2016
1 parent 5767b3b commit 70afff3
Showing 1 changed file with 21 additions and 5 deletions.
26 changes: 21 additions & 5 deletions OSS/MarkdownDeep/TableSpec.cs
Original file line number Diff line number Diff line change
Expand Up @@ -227,15 +227,31 @@ public static TableSpec Parse(StringScanner p)

#region RGregg extensions

public string[] ColumnHeaders { get { return Headers.ToArray(); } }
public string[] ColumnHeaders
{
get
{
if (null != Headers)
return Headers.ToArray();
else
return new string[0];
}
}

public string[][] RowValues
{
get
{
var rowArrays = from row in Rows
select row.ToArray();
return rowArrays.ToArray();
{
if (null != Rows)
{
var rowArrays = from row in Rows
select row.ToArray();
return rowArrays.ToArray();
}
else
{
return new string[][] { new string[] { } };
}
}
}

Expand Down

0 comments on commit 70afff3

Please sign in to comment.