Fix Cannot get class error when searching TextFile/OtherFile

This commit is contained in:
Jayden Sipe 2025-04-06 20:51:40 -04:00
parent d52b84e472
commit 1066e83262

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