summaryrefslogtreecommitdiff
path: root/modules/gdscript/gdscript_cache.cpp
diff options
context:
space:
mode:
authorrune-scape <allie.smith.epic@gmail.com>2022-11-20 03:17:16 -0500
committerrune-scape <allie.smith.epic@gmail.com>2022-11-20 03:17:16 -0500
commita6410878db26517213c7d7750ecc70bf82173941 (patch)
treecad2e20adeab543c8b260418b8d3e16021a5ff0b /modules/gdscript/gdscript_cache.cpp
parent895428c8058ce97abb02a6a3500e463f72a4f9c9 (diff)
Fix empty text in editor
Diffstat (limited to 'modules/gdscript/gdscript_cache.cpp')
-rw-r--r--modules/gdscript/gdscript_cache.cpp11
1 files changed, 6 insertions, 5 deletions
diff --git a/modules/gdscript/gdscript_cache.cpp b/modules/gdscript/gdscript_cache.cpp
index 40681d9771..00ae5f43c5 100644
--- a/modules/gdscript/gdscript_cache.cpp
+++ b/modules/gdscript/gdscript_cache.cpp
@@ -236,15 +236,16 @@ Ref<GDScript> GDScriptCache::get_shallow_script(const String &p_path, Error &r_e
return singleton->shallow_gdscript_cache[p_path];
}
- Ref<GDScriptParserRef> parser_ref = get_parser(p_path, GDScriptParserRef::PARSED, r_error);
- if (r_error != OK) {
- return Ref<GDScript>();
- }
-
Ref<GDScript> script;
script.instantiate();
script->set_path(p_path, true);
script->load_source_code(p_path);
+
+ Ref<GDScriptParserRef> parser_ref = get_parser(p_path, GDScriptParserRef::PARSED, r_error);
+ if (r_error != OK) {
+ return script;
+ }
+
GDScriptCompiler::make_scripts(script.ptr(), parser_ref->get_parser()->get_tree(), true);
singleton->shallow_gdscript_cache[p_path] = script;