浏览代码

Merge pull request #47519 from AndreaCatania/AndreaCatania-patch-4

Fixes editor crash on closing
Rémi Verschelde 4 年之前
父节点
当前提交
6b25c94bd6
共有 1 个文件被更改,包括 6 次插入1 次删除
  1. 6 1
      editor/plugins/node_3d_editor_plugin.cpp

+ 6 - 1
editor/plugins/node_3d_editor_plugin.cpp

@@ -4577,7 +4577,12 @@ void _update_all_gizmos(Node *p_node) {
 
 void Node3DEditor::update_all_gizmos(Node *p_node) {
 	if (!p_node) {
-		p_node = SceneTree::get_singleton()->get_root();
+		if (SceneTree::get_singleton()) {
+			p_node = SceneTree::get_singleton()->get_root();
+		} else {
+			// No scene tree, so nothing to update.
+			return;
+		}
 	}
 	_update_all_gizmos(p_node);
 }