Fix editor crash when expanding/collapsing empty scene tree

This commit is contained in:
Andreas Raddau 2021-12-01 20:18:20 +01:00
parent e223a9c129
commit 2b7eab7c87

View file

@ -419,6 +419,9 @@ void SceneTreeDock::_tool_selected(int p_tool, bool p_confirm_override) {
if (!selected_item) { if (!selected_item) {
selected_item = tree->get_root(); selected_item = tree->get_root();
if (!selected_item) {
break;
}
} }
bool collapsed = _is_collapsed_recursive(selected_item); bool collapsed = _is_collapsed_recursive(selected_item);