From 57661346104cf8e8a383592753711cfef976dcd7 Mon Sep 17 00:00:00 2001 From: RedworkDE <10944644+RedworkDE@users.noreply.github.com> Date: Tue, 28 Feb 2023 22:08:19 +0100 Subject: [PATCH] [3.x] C#: Fix crash when errors occur before language initialization. --- modules/mono/csharp_script.cpp | 10 +++++----- modules/mono/mono_gc_handle.cpp | 2 +- modules/mono/mono_gd/gd_mono.cpp | 4 ++-- modules/mono/mono_gd/gd_mono_utils.cpp | 8 ++++---- 4 files changed, 12 insertions(+), 12 deletions(-) diff --git a/modules/mono/csharp_script.cpp b/modules/mono/csharp_script.cpp index f77ccca0009..9da68c490f4 100644 --- a/modules/mono/csharp_script.cpp +++ b/modules/mono/csharp_script.cpp @@ -563,7 +563,7 @@ Vector CSharpLanguage::debug_get_current_stack_info() _TLS_RECURSION_GUARD_V_(Vector()); GD_MONO_SCOPE_THREAD_ATTACH; - if (!gdmono->is_runtime_initialized() || !GDMono::get_singleton()->get_core_api_assembly() || !GDMonoCache::cached_data.corlib_cache_updated) + if (!gdmono || !gdmono->is_runtime_initialized() || !GDMono::get_singleton()->get_core_api_assembly() || !GDMonoCache::cached_data.corlib_cache_updated) return Vector(); MonoObject *stack_trace = mono_object_new(mono_domain_get(), CACHED_CLASS(System_Diagnostics_StackTrace)->get_mono_ptr()); @@ -716,7 +716,7 @@ void CSharpLanguage::reload_tool_script(const Ref