Переглянути джерело

Merge pull request #32409 from bojidar-bg/32334-null-ptr-esgp

Fix crash in ~EditorSpatialGizmoPlugin when generating documentation data
Rémi Verschelde 6 роки тому
батько
коміт
b0f0e0e2fc
1 змінених файлів з 3 додано та 2 видалено
  1. 3 2
      editor/plugins/spatial_editor_plugin.cpp

+ 3 - 2
editor/plugins/spatial_editor_plugin.cpp

@@ -4062,7 +4062,6 @@ void _update_all_gizmos(Node *p_node) {
 
 void SpatialEditor::update_all_gizmos(Node *p_node) {
 	if (!p_node) {
-		if (!SceneTree::get_singleton()) return;
 		p_node = SceneTree::get_singleton()->get_root();
 	}
 	_update_all_gizmos(p_node);
@@ -6269,5 +6268,7 @@ EditorSpatialGizmoPlugin::~EditorSpatialGizmoPlugin() {
 		current_gizmos[i]->set_plugin(NULL);
 		current_gizmos[i]->get_spatial_node()->set_gizmo(NULL);
 	}
-	SpatialEditor::get_singleton()->update_all_gizmos();
+	if (SpatialEditor::get_singleton()) {
+		SpatialEditor::get_singleton()->update_all_gizmos();
+	}
 }