Fix imports of malformed XML by skipping errors

Also ended up adding an error to tell the users to double check their input file
This commit is contained in:
Matt Nadareski
2016-04-02 21:45:39 -07:00
parent de4a2e5570
commit 598041efb0

View File

@@ -356,6 +356,15 @@ namespace SabreTools
}
else
{
// There are rare cases where a malformed XML will not have the required attributes. We can only skip them.
if (node.Attributes.Count == 0)
{
_logger.Error(@"A node with malformed XML has been found!
For RV DATs, please make sure that all names and descriptions are quoted.
For XML DATs, make sure that the DAT has all required information.");
node = node.NextSibling;
continue;
}
tempname = node.Attributes["name"].Value;
}