Skip to content

Commit

Permalink
Merge pull request #88 from rgregg/master
Browse files Browse the repository at this point in the history
Fix crash for empty table headers or row
  • Loading branch information
rgregg committed Feb 19, 2016
2 parents d8d31b5 + 70afff3 commit 8ee8a93
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 8ee8a93

Please sign in to comment.