Преглед на файлове

Fix the error when clicking AnimationTree in the editor

Magian преди 2 години
родител
ревизия
0b3c073c9e
променени са 1 файла, в които са добавени 2 реда и са изтрити 1 реда
  1. 2 1
      editor/plugins/animation_tree_editor_plugin.cpp

+ 2 - 1
editor/plugins/animation_tree_editor_plugin.cpp

@@ -241,7 +241,8 @@ bool AnimationTreeEditor::can_edit(const Ref<AnimationNode> &p_node) const {
 }
 
 Vector<String> AnimationTreeEditor::get_animation_list() {
-	if (!singleton->is_visible()) {
+	if (!singleton->tree || !singleton->is_visible()) {
+		// When tree is empty, singleton not in the main thread.
 		return Vector<String>();
 	}