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

Fix `Cannot get class` error when searching `TextFile`/`OtherFile` in FileSystem dock
This commit is contained in:
Thaddeus Crews
2025-04-07 08:43:29 -05:00

View File

@ -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;
}