diff options
author | RĂ©mi Verschelde <remi@verschelde.fr> | 2021-08-17 13:34:07 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-08-17 13:34:07 +0200 |
commit | 21a0af2686bfa679844708ade1cc4b02abfba0e0 (patch) | |
tree | c3af72a30e5b19dc177f74b194031f57bb3c5e40 /modules/gdscript | |
parent | be80d381d27daf14ded507aaf9f173cdc1483046 (diff) | |
parent | 9973bf93ed04b98b4b8cb681316a07682b0ee72f (diff) |
Merge pull request #51762 from nekomatata/fix-crash-gdscript-cache
Fix crash when failing to load script from cache
Diffstat (limited to 'modules/gdscript')
-rw-r--r-- | modules/gdscript/gdscript_cache.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/modules/gdscript/gdscript_cache.cpp b/modules/gdscript/gdscript_cache.cpp index 1a844bf241..07f50d14dc 100644 --- a/modules/gdscript/gdscript_cache.cpp +++ b/modules/gdscript/gdscript_cache.cpp @@ -200,7 +200,9 @@ Ref<GDScript> GDScriptCache::get_full_script(const String &p_path, Error &r_erro if (singleton->full_gdscript_cache.has(p_path)) { return singleton->full_gdscript_cache[p_path]; } + Ref<GDScript> script = get_shallow_script(p_path); + ERR_FAIL_COND_V(script.is_null(), Ref<GDScript>()); r_error = script->load_source_code(p_path); |