diff options
author | RĂ©mi Verschelde <remi@verschelde.fr> | 2022-01-23 09:31:08 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-01-23 09:31:08 +0100 |
commit | 2f277994d2616e520b28d84c207abf040af1b48f (patch) | |
tree | ea5a50ad8373409a2b2282f9b3503bd8d993567a | |
parent | 3f9352848383af269f5c027ecc12b13615d21e35 (diff) | |
parent | b69b526b7c98ddad65bdbd2024641eff5b4bd421 (diff) |
Merge pull request #55493 from V-Sekai/gdscript-crash
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; |