Fix error when opening Anim Graph with node name not existing in skeleton anymore
Fixes #176
This commit is contained in:
@@ -32,8 +32,8 @@ namespace FlaxEditor.Surface.Elements
|
||||
}
|
||||
set
|
||||
{
|
||||
if (!string.IsNullOrEmpty(value))
|
||||
SelectedIndex = _nodeNameToIndex[value];
|
||||
if (!string.IsNullOrEmpty(value) && _nodeNameToIndex.TryGetValue(value, out var index))
|
||||
SelectedIndex = index;
|
||||
else
|
||||
SelectedIndex = -1;
|
||||
}
|
||||
@@ -60,8 +60,8 @@ namespace FlaxEditor.Surface.Elements
|
||||
{
|
||||
_selectedIndices.Clear();
|
||||
var selectedNode = (string)ParentNode.Values[Archetype.ValueIndex];
|
||||
if (!string.IsNullOrEmpty(selectedNode))
|
||||
_selectedIndices.Add(_nodeNameToIndex[selectedNode]);
|
||||
if (!string.IsNullOrEmpty(selectedNode) && _nodeNameToIndex.TryGetValue(selectedNode, out var index))
|
||||
_selectedIndices.Add(index);
|
||||
OnSelectedIndexChanged();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user