diff options
author | Ignacio Etcheverry <neikeq@users.noreply.github.com> | 2018-01-24 01:35:10 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-01-24 01:35:10 +0100 |
commit | e1ae7dffd3ffe29dedbf60a42fc5d1c0e4d9014a (patch) | |
tree | 5edb846f741647f0db6acd58ff23a6f677f15be7 | |
parent | 59e83af201af5a93c7a13750d781c050c2275c07 (diff) | |
parent | 8c33939ce6d9b1b1b4f3ff0eca2b60c371fbef85 (diff) |
Merge pull request #16016 from neikeq/issue-13316
Fix CSharpInstance::call not initializing CallError
-rw-r--r-- | modules/mono/csharp_script.cpp | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/modules/mono/csharp_script.cpp b/modules/mono/csharp_script.cpp index aee2481366..5bf2a4df35 100644 --- a/modules/mono/csharp_script.cpp +++ b/modules/mono/csharp_script.cpp @@ -1133,10 +1133,13 @@ Variant CSharpInstance::call(const StringName &p_method, const Variant **p_args, MonoObject *mono_object = get_mono_object(); - ERR_FAIL_NULL_V(mono_object, Variant()); + if (!mono_object) { + r_error.error = Variant::CallError::CALL_ERROR_INSTANCE_IS_NULL; + ERR_FAIL_V(Variant()); + } if (!script.is_valid()) - return Variant(); + ERR_FAIL_V(Variant()); GDMonoClass *top = script->script_class; @@ -1146,6 +1149,8 @@ Variant CSharpInstance::call(const StringName &p_method, const Variant **p_args, if (method) { MonoObject *return_value = method->invoke(mono_object, p_args); + r_error.error = Variant::CallError::CALL_OK; + if (return_value) { return GDMonoMarshal::mono_object_to_variant(return_value); } else { |