summaryrefslogtreecommitdiffstats
path: root/core
diff options
context:
space:
mode:
authorRémi Verschelde <rverschelde@gmail.com>2024-06-21 13:54:35 +0200
committerRémi Verschelde <rverschelde@gmail.com>2024-06-21 13:54:35 +0200
commit74f9f12c71c0b1cd66481cdc8b3b3432b7c541a6 (patch)
treef8fa1051926f8201101b648bc0e5d1f841b3d7b3 /core
parent04a530f91fc83b41112007dbd2ce02e9528df682 (diff)
parentf1099ab943859f1e1510ffef5782b4d9c599bf80 (diff)
downloadredot-engine-74f9f12c71c0b1cd66481cdc8b3b3432b7c541a6.tar.gz
Merge pull request #92320 from Hilderin/fix-importing-assets-with-csv
Fix reimporting assets with csv in the project
Diffstat (limited to 'core')
-rw-r--r--core/io/resource_importer.cpp14
1 files changed, 13 insertions, 1 deletions
diff --git a/core/io/resource_importer.cpp b/core/io/resource_importer.cpp
index 4c16650439..9e6f3ba314 100644
--- a/core/io/resource_importer.cpp
+++ b/core/io/resource_importer.cpp
@@ -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;
}