From 5aefe5d93692d09b6cf57daab5b6846a68dd3a16 Mon Sep 17 00:00:00 2001 From: Ignacio Etcheverry Date: Wed, 25 Jul 2018 21:30:11 +0200 Subject: Mono: Fix null dereferences --- modules/mono/csharp_script.cpp | 3 +++ 1 file changed, 3 insertions(+) (limited to 'modules/mono/csharp_script.cpp') diff --git a/modules/mono/csharp_script.cpp b/modules/mono/csharp_script.cpp index 996e73a4bb..d1b7917023 100644 --- a/modules/mono/csharp_script.cpp +++ b/modules/mono/csharp_script.cpp @@ -2040,6 +2040,9 @@ void CSharpScript::set_source_code(const String &p_code) { bool CSharpScript::has_method(const StringName &p_method) const { + if (!script_class) + return false; + return script_class->has_fetched_method_unknown_params(p_method); } -- cgit v1.2.3 From 8edf85b09c014bee48adcc515a46cf315ef393f5 Mon Sep 17 00:00:00 2001 From: Ignacio Etcheverry Date: Wed, 25 Jul 2018 21:30:43 +0200 Subject: Fix '!valid' error spam on C# script instance create --- modules/mono/csharp_script.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'modules/mono/csharp_script.cpp') diff --git a/modules/mono/csharp_script.cpp b/modules/mono/csharp_script.cpp index d1b7917023..44993674c1 100644 --- a/modules/mono/csharp_script.cpp +++ b/modules/mono/csharp_script.cpp @@ -1963,8 +1963,6 @@ Variant CSharpScript::_new(const Variant **p_args, int p_argcount, Variant::Call ScriptInstance *CSharpScript::instance_create(Object *p_this) { - ERR_FAIL_COND_V(!valid, NULL); - if (!tool && !ScriptServer::is_scripting_enabled()) { #ifdef TOOLS_ENABLED PlaceHolderScriptInstance *si = memnew(PlaceHolderScriptInstance(CSharpLanguage::get_singleton(), Ref