1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-06 12:20:30 +00:00

Fixes editor crash on closing

Fixes editor crash when the gizmo is destroyed and the `SceneTree` is already freed.

(cherry picked from commit 79f55fcded)
This commit is contained in:
AndreaCatania
2021-03-31 11:53:32 +02:00
committed by Rémi Verschelde
parent 5fdb8b02e3
commit bd5663e2cf

View File

@@ -4470,7 +4470,12 @@ void _update_all_gizmos(Node *p_node) {
void SpatialEditor::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);
}