diff options
author | K. S. Ernest (iFire) Lee <ernest.lee@chibifire.com> | 2021-11-01 00:35:05 -0700 |
---|---|---|
committer | Lyuma <xn.lyuma@gmail.com> | 2022-01-22 17:42:54 -0800 |
commit | b69b526b7c98ddad65bdbd2024641eff5b4bd421 (patch) | |
tree | 21a47c4146788fbd2643774b5051c7e93ca6815f | |
parent | e363f404a5605517b1b901a7c90986741bc29d22 (diff) |
GDScript cache crashfix.
-rw-r--r-- | modules/gdscript/gdscript_cache.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/modules/gdscript/gdscript_cache.cpp b/modules/gdscript/gdscript_cache.cpp index 4ac5a4a60e..6ada7d36f5 100644 --- a/modules/gdscript/gdscript_cache.cpp +++ b/modules/gdscript/gdscript_cache.cpp @@ -122,6 +122,10 @@ Ref<GDScriptParserRef> GDScriptCache::get_parser(const String &p_path, GDScriptP } if (singleton->parser_map.has(p_path)) { ref = Ref<GDScriptParserRef>(singleton->parser_map[p_path]); + if (ref.is_null()) { + r_error = ERR_INVALID_DATA; + return ref; + } } else { if (!FileAccess::exists(p_path)) { r_error = ERR_FILE_NOT_FOUND; @@ -133,7 +137,6 @@ Ref<GDScriptParserRef> GDScriptCache::get_parser(const String &p_path, GDScriptP ref->path = p_path; singleton->parser_map[p_path] = ref.ptr(); } - r_error = ref->raise_status(p_status); return ref; |