Fix reimporting assets with csv in the project

This commit is contained in:
Hilderin 2024-05-24 11:32:33 -04:00
parent b7feebefab
commit f1099ab943
2 changed files with 24 additions and 3 deletions

View file

@ -118,9 +118,21 @@ Error ResourceFormatImporter::_get_path_and_type(const String &p_path, PathAndTy
}
#endif
if (r_path_and_type.path.is_empty() || r_path_and_type.type.is_empty()) {
if (r_path_and_type.type.is_empty()) {
return ERR_FILE_CORRUPT;
}
if (r_path_and_type.path.is_empty()) {
// Some importers may not write files to the .godot folder, so the path can be empty.
if (r_path_and_type.importer.is_empty()) {
return ERR_FILE_CORRUPT;
}
// It's only invalid if the extension for the importer is not empty.
Ref<ResourceImporter> importer = get_importer_by_name(r_path_and_type.importer);
if (importer.is_null() || !importer->get_save_extension().is_empty()) {
return ERR_FILE_CORRUPT;
}
}
return OK;
}