fix: Fixed bug preventing deserialization of XML lists

This commit is contained in:
Chris Cameron
2019-03-01 14:29:46 -05:00
parent 4a330637a7
commit e3a4713b3b
2 changed files with 8 additions and 1 deletions

View File

@@ -72,7 +72,12 @@ namespace ICD.Common.Utils.Xml
throw new ArgumentNullException("type");
using (IcdXmlReader reader = new IcdXmlReader(xml))
return DeserializeObject(type, reader);
{
if (reader.ReadToNextElement())
return DeserializeObject(type, reader);
throw new FormatException("Expected element in XML");
}
}
/// <summary>