diff options
author | RedworkDE <10944644+RedworkDE@users.noreply.github.com> | 2023-02-28 22:08:19 +0100 |
---|---|---|
committer | Yuri Sizov <yuris@humnom.net> | 2023-03-13 14:21:06 +0100 |
commit | 0112862e70819f700fd86104a136795fcbe1c80e (patch) | |
tree | 77ef67856afebd4460d65cb46fc9b858fcf5d744 /modules | |
parent | 234c601a61d7ec5c0165fa6cb277fae430557e88 (diff) |
C#: Fix crash when errors occur before language initialization.
(cherry picked from commit c0ebc281360c7df1acae4b0510d8310573491acc)
Diffstat (limited to 'modules')
-rw-r--r-- | modules/mono/csharp_script.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/modules/mono/csharp_script.cpp b/modules/mono/csharp_script.cpp index 9159f308a2..aad8ab9a57 100644 --- a/modules/mono/csharp_script.cpp +++ b/modules/mono/csharp_script.cpp @@ -581,7 +581,7 @@ Vector<ScriptLanguage::StackInfo> CSharpLanguage::debug_get_current_stack_info() _recursion_flag_ = false; }; - if (!gdmono->is_runtime_initialized()) { + if (!gdmono || !gdmono->is_runtime_initialized()) { return Vector<StackInfo>(); } @@ -671,6 +671,7 @@ void CSharpLanguage::reload_tool_script(const Ref<Script> &p_script, bool p_soft #ifdef GD_MONO_HOT_RELOAD bool CSharpLanguage::is_assembly_reloading_needed() { + ERR_FAIL_NULL_V(gdmono, false); if (!gdmono->is_runtime_initialized()) { return false; } @@ -705,6 +706,7 @@ bool CSharpLanguage::is_assembly_reloading_needed() { } void CSharpLanguage::reload_assemblies(bool p_soft_reload) { + ERR_FAIL_NULL(gdmono); if (!gdmono->is_runtime_initialized()) { return; } |