Fix crash when refreshing nodes with list tag on modified path.

This commit is contained in:
Justin Aquadro 2014-04-01 22:21:38 -04:00
parent 6412629678
commit 2a043ba09c

View file

@ -219,10 +219,7 @@ namespace NBTExplorer.Model
foreach (DataNode child in node.Nodes) {
Dictionary<string, object> childDict = BuildExpandSet(child);
if (childDict != null) {
if (!String.IsNullOrEmpty(child.NodeName))
dict[child.NodeName] = childDict;
else
dict[child.NodeDisplay] = childDict;
dict[child.NodePathName] = childDict;
}
}
@ -237,13 +234,8 @@ namespace NBTExplorer.Model
node.Expand();
foreach (DataNode child in node.Nodes) {
if (expandSet.ContainsKey(child.NodeName)) {
Dictionary<string, object> childDict = (Dictionary<string, object>)expandSet[child.NodeName];
if (childDict != null)
RestoreExpandSet(child, childDict);
}
else if (expandSet.ContainsKey(child.NodeDisplay)) {
Dictionary<string, object> childDict = (Dictionary<string, object>)expandSet[child.NodeDisplay];
if (expandSet.ContainsKey(child.NodePathName)) {
Dictionary<string, object> childDict = (Dictionary<string, object>)expandSet[child.NodePathName];
if (childDict != null)
RestoreExpandSet(child, childDict);
}