Skip to content

Commit

Permalink
fix CT_Text.Write if text is null
Browse files Browse the repository at this point in the history
If valueField is null do nothing
fix #180
  • Loading branch information
tonyqus committed Jun 25, 2021
1 parent 3cb6417 commit 65733f3
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion OpenXmlFormats/Wordprocessing/wml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2258,7 +2258,10 @@ internal void Write(StreamWriter sw, string nodeName)
this.space = "preserve";
XmlHelper.WriteAttribute(sw, "xml:space", this.space);
sw.Write(">");
sw.Write(XmlHelper.EncodeXml(this.valueField));
if (this.valueField != null)
{
sw.Write(XmlHelper.EncodeXml(this.valueField));
}
sw.Write(string.Format("</w:{0}>", nodeName));
}

Expand Down

0 comments on commit 65733f3

Please sign in to comment.