check for NomaiObject

This commit is contained in:
Noah Pilarski 2022-11-24 18:58:49 -05:00
parent d133cd4709
commit 53474c63c3

View File

@ -716,6 +716,12 @@ namespace NewHorizons.Builder.Props
XmlDocument xmlDocument = new XmlDocument(); XmlDocument xmlDocument = new XmlDocument();
xmlDocument.LoadXml(xmlPath); xmlDocument.LoadXml(xmlPath);
XmlNode rootNode = xmlDocument.SelectSingleNode("NomaiObject"); XmlNode rootNode = xmlDocument.SelectSingleNode("NomaiObject");
if (rootNode == null)
{
Logger.LogError($"Couldn't find NomaiObject in [{xmlPath}]");
return dict;
}
foreach (object obj in rootNode.SelectNodes("TextBlock")) foreach (object obj in rootNode.SelectNodes("TextBlock"))
{ {