summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <remi@verschelde.fr>2021-12-02 00:20:24 +0100
committerGitHub <noreply@github.com>2021-12-02 00:20:24 +0100
commit702ffc6243bb1073a454fc713a5a3c2b44b59c93 (patch)
treed498afea3a17ca10eac2e0e6618f489e32a2abbd
parent3b9de26fec42ba99153717f89afd849f77a60a89 (diff)
parent2b7eab7c87f87fecf1dd382d3bc350abb7636598 (diff)
Merge pull request #55525 from and-rad/expand-tree-crash-fix
-rw-r--r--editor/scene_tree_dock.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/editor/scene_tree_dock.cpp b/editor/scene_tree_dock.cpp
index a03871f33c..cf89120beb 100644
--- a/editor/scene_tree_dock.cpp
+++ b/editor/scene_tree_dock.cpp
@@ -419,6 +419,9 @@ void SceneTreeDock::_tool_selected(int p_tool, bool p_confirm_override) {
if (!selected_item) {
selected_item = tree->get_root();
+ if (!selected_item) {
+ break;
+ }
}
bool collapsed = _is_collapsed_recursive(selected_item);