Skip to content

Commit

Permalink
Should be able to serialize empty XML elements as string lists
Browse files Browse the repository at this point in the history
  • Loading branch information
martinmine committed May 1, 2022
1 parent 873334b commit 7251e30
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/SerializableStringList.cs
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,11 @@ public SerializableStringList(string str)

public void ReadXml(XmlReader reader)
{
Items = Parse(reader.ReadString());
reader.ReadEndElement();
if (reader.ValueType.Name == "string")
{
Items = Parse(reader.ReadString());
reader.ReadEndElement();
}
}

private IList<string> Parse(string value)
Expand Down

0 comments on commit 7251e30

Please sign in to comment.