summaryrefslogtreecommitdiff
path: root/editor
diff options
context:
space:
mode:
authorAndreaCatania <info@andreacatania.com>2021-03-31 11:53:32 +0200
committerAndreaCatania <info@andreacatania.com>2021-03-31 11:53:32 +0200
commit79f55fcded4f244cf632434f9c1f7cf7ccb0161a (patch)
tree63ffa0b293bf64732499731b90d5c7eb99f378fe /editor
parent187be733aac2cb368ee23254d199ff4c71162701 (diff)
Fixes editor crash on closing
Fixes editor crash when the gizmo is destroyed and the `SceneTree` is already freed.
Diffstat (limited to 'editor')
-rw-r--r--editor/plugins/node_3d_editor_plugin.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/editor/plugins/node_3d_editor_plugin.cpp b/editor/plugins/node_3d_editor_plugin.cpp
index 4d7be66180..6b909d7ec8 100644
--- a/editor/plugins/node_3d_editor_plugin.cpp
+++ b/editor/plugins/node_3d_editor_plugin.cpp
@@ -4503,7 +4503,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);
}