From d894f48f25f745ae5db54a3afdb240a99df4bae7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alessandro=20Fam=C3=A0?= Date: Tue, 28 Jun 2022 20:36:47 +0200 Subject: [PATCH] Fix crash when using static methods without return value --- include/godot_cpp/core/method_bind.hpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/include/godot_cpp/core/method_bind.hpp b/include/godot_cpp/core/method_bind.hpp index 1b51722a..52479986 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_arg, pi); + if (p_arg >= 0 && p_arg < (int)sizeof...(P)) { + call_get_argument_type_info(p_arg, pi); + } else { + pi = PropertyInfo(); + } return pi; } #if defined(__GNUC__) && !defined(__clang__)