浏览代码

Ignore node rename if already exited blend tree

(cherry picked from commit f9bee9099457a7e582ad785f5134a86ed1f8fac5)
dzil123 3 年之前
父节点
当前提交
c86f4c7f58
共有 1 个文件被更改,包括 4 次插入0 次删除
  1. 4 0
      editor/plugins/animation_blend_tree_editor_plugin.cpp

+ 4 - 0
editor/plugins/animation_blend_tree_editor_plugin.cpp

@@ -843,6 +843,10 @@ void AnimationNodeBlendTreeEditor::_bind_methods() {
 AnimationNodeBlendTreeEditor *AnimationNodeBlendTreeEditor::singleton = nullptr;
 AnimationNodeBlendTreeEditor *AnimationNodeBlendTreeEditor::singleton = nullptr;
 
 
 void AnimationNodeBlendTreeEditor::_node_renamed(const String &p_text, Ref<AnimationNode> p_node) {
 void AnimationNodeBlendTreeEditor::_node_renamed(const String &p_text, Ref<AnimationNode> p_node) {
+	if (blend_tree.is_null()) {
+		return;
+	}
+
 	String prev_name = blend_tree->get_node_name(p_node);
 	String prev_name = blend_tree->get_node_name(p_node);
 	ERR_FAIL_COND(prev_name == String());
 	ERR_FAIL_COND(prev_name == String());
 	GraphNode *gn = Object::cast_to<GraphNode>(graph->get_node(prev_name));
 	GraphNode *gn = Object::cast_to<GraphNode>(graph->get_node(prev_name));