diff options
author | Rémi Verschelde <rverschelde@gmail.com> | 2018-05-01 19:17:43 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-05-01 19:17:43 +0200 |
commit | c5fe3d9d93f8e4890b39f23dabe9c0d21fac09de (patch) | |
tree | cc2646f4273c356713d087c49bc7349b7cb3878e /core/variant.cpp | |
parent | de97339a2d66cc9e3bd9ab77dd4e0c5c6534a869 (diff) | |
parent | 8d5c30ce83c2ec69403338f9bc2809aef6f1539b (diff) | |
download | redot-engine-c5fe3d9d93f8e4890b39f23dabe9c0d21fac09de.tar.gz |
Merge pull request #18530 from garyo/missing-arg-err
Handle missing arg pointer in Variant::get_call_error_text
Diffstat (limited to 'core/variant.cpp')
-rw-r--r-- | core/variant.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/core/variant.cpp b/core/variant.cpp index 5d48c8785e..a6df95e310 100644 --- a/core/variant.cpp +++ b/core/variant.cpp @@ -3167,7 +3167,11 @@ String Variant::get_call_error_text(Object *p_base, const StringName &p_method, if (ce.error == Variant::CallError::CALL_ERROR_INVALID_ARGUMENT) { int errorarg = ce.argument; - err_text = "Cannot convert argument " + itos(errorarg + 1) + " from " + Variant::get_type_name(p_argptrs[errorarg]->get_type()) + " to " + Variant::get_type_name(ce.expected) + "."; + if (p_argptrs) { + err_text = "Cannot convert argument " + itos(errorarg + 1) + " from " + Variant::get_type_name(p_argptrs[errorarg]->get_type()) + " to " + Variant::get_type_name(ce.expected) + "."; + } else { + err_text = "Cannot convert argument " + itos(errorarg + 1) + " from [missing argptr, type unknown] to " + Variant::get_type_name(ce.expected) + "."; + } } else if (ce.error == Variant::CallError::CALL_ERROR_TOO_MANY_ARGUMENTS) { err_text = "Method expected " + itos(ce.argument) + " arguments, but called with " + itos(p_argcount) + "."; } else if (ce.error == Variant::CallError::CALL_ERROR_TOO_FEW_ARGUMENTS) { |