Merge pull request #92320 from Hilderin/fix-importing-assets-with-csv
Fix reimporting assets with csv in the project
This commit is contained in:
commit
74f9f12c71
2 changed files with 24 additions and 3 deletions
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue