From 3770ee3c9e00290ff10f9ce0348d6a652d8db9c1 Mon Sep 17 00:00:00 2001 From: Nolan Carroll Date: Thu, 28 Sep 2023 12:10:18 -0400 Subject: [PATCH] avoid cleanup for non-loadable assets --- editor/import_dock.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/editor/import_dock.cpp b/editor/import_dock.cpp index d13c0e7f863..5996b459a56 100644 --- a/editor/import_dock.cpp +++ b/editor/import_dock.cpp @@ -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 = 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; + } } } }