From d2c8741a69c2314de685611d8fa479f0689a7cf2 Mon Sep 17 00:00:00 2001 From: kobewi Date: Sat, 4 Jun 2022 00:04:49 +0200 Subject: [PATCH] Fix crash with empty scenes --- editor/scene_tree_editor.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/editor/scene_tree_editor.cpp b/editor/scene_tree_editor.cpp index b5b70b827b6..5536e09da7c 100644 --- a/editor/scene_tree_editor.cpp +++ b/editor/scene_tree_editor.cpp @@ -584,6 +584,11 @@ bool SceneTreeEditor::_update_filter(TreeItem *p_parent, bool p_scroll_to_select p_parent = tree->get_root(); } + if (!p_parent) { + // Tree is empty, nothing to do here. + return false; + } + bool keep = false; for (TreeItem *child = p_parent->get_first_child(); child; child = child->get_next()) { keep = _update_filter(child, p_scroll_to_selected) || keep;