Skip to content

Commit 7251e30

Browse files
committed
Should be able to serialize empty XML elements as string lists
1 parent 873334b commit 7251e30

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/SerializableStringList.cs

+5-2
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,11 @@ public SerializableStringList(string str)
3030

3131
public void ReadXml(XmlReader reader)
3232
{
33-
Items = Parse(reader.ReadString());
34-
reader.ReadEndElement();
33+
if (reader.ValueType.Name == "string")
34+
{
35+
Items = Parse(reader.ReadString());
36+
reader.ReadEndElement();
37+
}
3538
}
3639

3740
private IList<string> Parse(string value)

0 commit comments

Comments
 (0)