summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPouleyKetchoupp <pouleyketchoup@gmail.com>2021-08-16 16:27:25 -0700
committerPouleyKetchoupp <pouleyketchoup@gmail.com>2021-08-16 16:27:25 -0700
commit9973bf93ed04b98b4b8cb681316a07682b0ee72f (patch)
tree7b6a5a8bc4968f0a99ef875c8036b497ff109ae0
parent43440228db9fd230934c2022aade105478f449ca (diff)
Fix crash when failing to load script from cache
-rw-r--r--modules/gdscript/gdscript_cache.cpp2
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);