# HG changeset patch # User IBBoard # Date 1253995026 0 # Node ID dd892567f05434113a3ace175d5ce64272e29a8d # Parent 0c0e14f0378513a583277ca2247b25cf098c9e5a Fixes #174: HTML output can add empty tables for stat lines * Check if table has rows before outputting it diff -r 0c0e14f03785 -r dd892567f054 api/Exporters/WarFoundryHtmlExporter.cs --- a/api/Exporters/WarFoundryHtmlExporter.cs Sat Sep 26 19:51:11 2009 +0000 +++ b/api/Exporters/WarFoundryHtmlExporter.cs Sat Sep 26 19:57:06 2009 +0000 @@ -56,8 +56,11 @@ body.AppendChild(header); foreach (XmlElement table in CreateTables(army, doc)) - { - body.AppendChild(table); + { + if (!IsTableOnlyHeader(table)) + { + body.AppendChild(table); + } } StreamWriter writer = new StreamWriter(path, false); @@ -70,6 +73,11 @@ { writer.Close(); } + } + + private bool IsTableOnlyHeader(XmlElement table) + { + return table.ChildNodes.Count == 1; } private XmlElement[] CreateTables(Army army, XmlDocument doc)