From 34811c1f1e6f8d623b1cb29a3e0dd1dfa44ffe33 Mon Sep 17 00:00:00 2001 From: Matthew Borkowski Date: Wed, 18 Oct 2023 04:18:29 -0400 Subject: [PATCH] Fix `GDScriptCache::get_full_script` eating parsing errors because of early exit Fixes #75545. (cherry picked from commit 2d262c072bacc6f207e60c10fafad065388029a6) --- modules/gdscript/gdscript_cache.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/modules/gdscript/gdscript_cache.cpp b/modules/gdscript/gdscript_cache.cpp index e5bb93e3c8e..68e0af3cfa7 100644 --- a/modules/gdscript/gdscript_cache.cpp +++ b/modules/gdscript/gdscript_cache.cpp @@ -287,7 +287,8 @@ Ref GDScriptCache::get_full_script(const String &p_path, Error &r_erro if (script.is_null()) { script = get_shallow_script(p_path, r_error); - if (r_error) { + // Only exit early if script failed to load, otherwise let reload report errors. + if (script.is_null()) { return script; } }