diff options
author | Alessandro Famà <me@alessandrofama.com> | 2022-06-28 20:36:47 +0200 |
---|---|---|
committer | Alessandro Famà <me@alessandrofama.com> | 2022-07-03 17:00:43 +0200 |
commit | d894f48f25f745ae5db54a3afdb240a99df4bae7 (patch) | |
tree | d050ce3ef11709974583df6ba8ec666ce98865bc /include/godot_cpp | |
parent | d8a65edc4a681433fc3c2f0a19dee783ca6015df (diff) | |
download | redot-cpp-d894f48f25f745ae5db54a3afdb240a99df4bae7.tar.gz |
Fix crash when using static methods without return value
Diffstat (limited to 'include/godot_cpp')
-rw-r--r-- | include/godot_cpp/core/method_bind.hpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/include/godot_cpp/core/method_bind.hpp b/include/godot_cpp/core/method_bind.hpp index 1b51722..5247998 100644 --- a/include/godot_cpp/core/method_bind.hpp +++ b/include/godot_cpp/core/method_bind.hpp @@ -600,7 +600,11 @@ protected: virtual GDNativePropertyInfo gen_argument_type_info(int p_arg) const { GDNativePropertyInfo pi; - call_get_argument_type_info<P...>(p_arg, pi); + if (p_arg >= 0 && p_arg < (int)sizeof...(P)) { + call_get_argument_type_info<P...>(p_arg, pi); + } else { + pi = PropertyInfo(); + } return pi; } #if defined(__GNUC__) && !defined(__clang__) |