diff options
author | Andreas Raddau <raddau@robopoets.com> | 2021-12-01 20:18:20 +0100 |
---|---|---|
committer | Andreas Raddau <raddau@robopoets.com> | 2021-12-01 20:18:20 +0100 |
commit | 2b7eab7c87f87fecf1dd382d3bc350abb7636598 (patch) | |
tree | 8c427efe144b47ae3da1371c29529459e21b7b27 | |
parent | e223a9c12905b99bb1fe93a56ae634b34eadd359 (diff) |
Fix editor crash when expanding/collapsing empty scene tree
-rw-r--r-- | editor/scene_tree_dock.cpp | 3 |
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); |