From 9973bf93ed04b98b4b8cb681316a07682b0ee72f Mon Sep 17 00:00:00 2001 From: PouleyKetchoupp Date: Mon, 16 Aug 2021 16:27:25 -0700 Subject: Fix crash when failing to load script from cache --- modules/gdscript/gdscript_cache.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'modules/gdscript') 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 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 script = get_shallow_script(p_path); + ERR_FAIL_COND_V(script.is_null(), Ref()); r_error = script->load_source_code(p_path); -- cgit v1.2.3