Merge pull request #82490 from NolanDC/fix_reimport_crash_for_non_loadable_assets

Avoid import dock cleanup for non-loadable assets
This commit is contained in:
Rémi Verschelde 2023-10-03 17:24:07 +02:00
commit 4e1fce3c6f
No known key found for this signature in database
GPG key ID: C3336907360768E1

View file

@ -499,9 +499,12 @@ void ImportDock::_reimport_attempt() {
String imported_with = config->get_value("remap", "importer");
if (imported_with != importer_name) {
need_cleanup.push_back(params->paths[i]);
if (_find_owners(EditorFileSystem::get_singleton()->get_filesystem(), params->paths[i])) {
used_in_resources = true;
Ref<Resource> resource = ResourceLoader::load(params->paths[i]);
if (resource.is_valid()) {
need_cleanup.push_back(params->paths[i]);
if (_find_owners(EditorFileSystem::get_singleton()->get_filesystem(), params->paths[i])) {
used_in_resources = true;
}
}
}
}