diff options
author | Rémi Verschelde <remi@verschelde.fr> | 2022-06-05 01:28:56 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-06-05 01:28:56 +0200 |
commit | eaffb88558b6ef2a4c20ad7d1da94e3d1d4c0f4a (patch) | |
tree | 62e76c7374a98014f991749efc20cce920ab2b6d /editor | |
parent | 2426a67e707e2aced3717c492b79b9db3d467e13 (diff) | |
parent | d2c8741a69c2314de685611d8fa479f0689a7cf2 (diff) |
Merge pull request #61678 from KoBeWi/🌲💥
Fix crash with empty scenes
Diffstat (limited to 'editor')
-rw-r--r-- | editor/scene_tree_editor.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/editor/scene_tree_editor.cpp b/editor/scene_tree_editor.cpp index b5b70b827b..5536e09da7 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; |