From 27d70924a00ef2e199426d3facd8fa5dd7151bb5 Mon Sep 17 00:00:00 2001 From: Pieter-Jan Briers Date: Fri, 11 May 2018 13:50:56 +0200 Subject: [PATCH] Fixes ObjectDB leak printout with mono. Fixes #18767 --- modules/mono/csharp_script.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/modules/mono/csharp_script.cpp b/modules/mono/csharp_script.cpp index bbe245951e..75249fe47d 100644 --- a/modules/mono/csharp_script.cpp +++ b/modules/mono/csharp_script.cpp @@ -1726,6 +1726,12 @@ void CSharpScript::_clear() { Variant CSharpScript::call(const StringName &p_method, const Variant **p_args, int p_argcount, Variant::CallError &r_error) { + if (unlikely(GDMono::get_singleton() == NULL)) { + // Probably not the best error but eh. + r_error.error = Variant::CallError::CALL_ERROR_INSTANCE_IS_NULL; + return Variant(); + } + GDMonoClass *top = script_class; while (top && top != native) {