Browse Source

Merge pull request #111934 from KoBeWi/crash_in_files

Fix FindInFiles crash when changing language
Thaddeus Crews 1 month ago
parent
commit
add458d5f9
1 changed files with 1 additions and 1 deletions
  1. 1 1
      editor/script/find_in_files.cpp

+ 1 - 1
editor/script/find_in_files.cpp

@@ -1068,7 +1068,7 @@ void FindInFilesPanel::_on_button_clicked(TreeItem *p_item, int p_column, int p_
 		if (_file_items_results_count.has(item_parent)) {
 			_file_items_results_count[item_parent]--;
 		}
-		if (item_parent->get_child_count() < 2) {
+		if (item_parent->get_child_count() < 2 && item_parent != _results_display->get_root()) {
 			_file_items.erase(item_parent->get_metadata(0));
 			get_tree()->queue_delete(item_parent);
 		}