Browse Source

Merge pull request #104789 from jaydensipe/fix-textfile-class-error

Fix `Cannot get class` error when searching `TextFile`/`OtherFile` in FileSystem dock
Thaddeus Crews 4 months ago
parent
commit
4f8c90ae61
1 changed files with 2 additions and 2 deletions
  1. 2 2
      editor/filesystem_dock.cpp

+ 2 - 2
editor/filesystem_dock.cpp

@@ -274,7 +274,7 @@ void FileSystemDock::_create_tree(TreeItem *p_parent, EditorFileSystemDirectory
 		List<FileInfo> file_list;
 		for (int i = 0; i < p_dir->get_file_count(); i++) {
 			String file_type = p_dir->get_file_type(i);
-			if (file_type != "TextFile" && file_type != "OtherFile" && _is_file_type_disabled_by_feature_profile(file_type)) {
+			if (_is_file_type_disabled_by_feature_profile(file_type)) {
 				// If type is disabled, file won't be displayed.
 				continue;
 			}
@@ -848,7 +848,7 @@ void FileSystemDock::_set_file_display(bool p_active) {
 
 bool FileSystemDock::_is_file_type_disabled_by_feature_profile(const StringName &p_class) {
 	Ref<EditorFeatureProfile> profile = EditorFeatureProfileManager::get_singleton()->get_current_profile();
-	if (profile.is_null()) {
+	if (profile.is_null() || !ClassDB::class_exists(p_class)) {
 		return false;
 	}