From 955049670f5c2234180715ce27dc7a4d62b2bfb2 Mon Sep 17 00:00:00 2001 From: "ocean (they/them)" Date: Fri, 7 Jul 2023 11:13:48 -0400 Subject: [PATCH] GDScript: Add static analysis error reporting in GDScriptCache::get_full_script() --- modules/gdscript/gdscript_cache.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/modules/gdscript/gdscript_cache.cpp b/modules/gdscript/gdscript_cache.cpp index e5bb93e3c8ed..d191bd022474 100644 --- a/modules/gdscript/gdscript_cache.cpp +++ b/modules/gdscript/gdscript_cache.cpp @@ -294,8 +294,12 @@ Ref GDScriptCache::get_full_script(const String &p_path, Error &r_erro if (p_update_from_disk) { r_error = script->load_source_code(p_path); + if (r_error) { + return script; + } } + r_error = script->reload(true); if (r_error) { return script; } @@ -303,7 +307,6 @@ Ref GDScriptCache::get_full_script(const String &p_path, Error &r_erro singleton->full_gdscript_cache[p_path] = script; singleton->shallow_gdscript_cache.erase(p_path); - script->reload(true); return script; }