From ed9dc792df29904261e839edcb370e31d063b85f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pedro=20J=2E=20Est=C3=A9banez?= Date: Sat, 20 May 2023 11:45:02 +0200 Subject: [PATCH] Avoid error spam on first opening of a not yet imported project --- editor/editor_file_system.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/editor/editor_file_system.cpp b/editor/editor_file_system.cpp index 74eb2777edb..5ed314c9860 100644 --- a/editor/editor_file_system.cpp +++ b/editor/editor_file_system.cpp @@ -1506,6 +1506,16 @@ void EditorFileSystem::_save_late_updated_files() { } Vector EditorFileSystem::_get_dependencies(const String &p_path) { + // Avoid error spam on first opening of a not yet imported project by treating the following situation + // as a benign one, not letting the file open error happen: the resource is of an importable type but + // it has not been imported yet. + if (ResourceFormatImporter::get_singleton()->recognize_path(p_path)) { + const String &internal_path = ResourceFormatImporter::get_singleton()->get_internal_resource_path(p_path); + if (!internal_path.is_empty() && !FileAccess::exists(internal_path)) { // If path is empty (error), keep the code flow to the error. + return Vector(); + } + } + List deps; ResourceLoader::get_dependencies(p_path, &deps);