summaryrefslogtreecommitdiffstats
path: root/include/godot_cpp
diff options
context:
space:
mode:
authorAlessandro Famà <me@alessandrofama.com>2022-06-28 20:36:47 +0200
committerAlessandro Famà <me@alessandrofama.com>2022-07-03 17:00:43 +0200
commitd894f48f25f745ae5db54a3afdb240a99df4bae7 (patch)
treed050ce3ef11709974583df6ba8ec666ce98865bc /include/godot_cpp
parentd8a65edc4a681433fc3c2f0a19dee783ca6015df (diff)
downloadredot-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.hpp6
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__)