Browse Source

Fix crash when using static methods without return value

Alessandro Famà 3 years ago
parent
commit
d894f48f25
1 changed files with 5 additions and 1 deletions
  1. 5 1
      include/godot_cpp/core/method_bind.hpp

+ 5 - 1
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__)