Fix crash when switching to a different node from AnimationTree

This commit is contained in:
SaracenOne 2023-01-25 14:27:16 +00:00
parent 41e5f5b093
commit f424a748ff
2 changed files with 12 additions and 8 deletions

View file

@ -65,13 +65,14 @@ void AnimationTreeEditor::edit(AnimationTree *p_tree) {
tree = p_tree;
Vector<String> path;
if (tree && tree->has_meta("_tree_edit_path")) {
path = tree->get_meta("_tree_edit_path");
} else {
current_root = ObjectID();
if (tree) {
if (tree->has_meta("_tree_edit_path")) {
path = tree->get_meta("_tree_edit_path");
} else {
current_root = ObjectID();
}
edit_path(path);
}
edit_path(path);
}
void AnimationTreeEditor::_node_removed(Node *p_node) {