From 2b7eab7c87f87fecf1dd382d3bc350abb7636598 Mon Sep 17 00:00:00 2001 From: Andreas Raddau Date: Wed, 1 Dec 2021 20:18:20 +0100 Subject: Fix editor crash when expanding/collapsing empty scene tree --- editor/scene_tree_dock.cpp | 3 +++ 1 file changed, 3 insertions(+) (limited to 'editor') 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); -- cgit v1.2.3