Selaa lähdekoodia

Fix crash when using static methods without return value

Alessandro Famà 3 vuotta sitten
vanhempi
commit
d894f48f25
1 muutettua tiedostoa jossa 5 lisäystä ja 1 poistoa
  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 {
 	virtual GDNativePropertyInfo gen_argument_type_info(int p_arg) const {
 		GDNativePropertyInfo pi;
 		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;
 		return pi;
 	}
 	}
 #if defined(__GNUC__) && !defined(__clang__)
 #if defined(__GNUC__) && !defined(__clang__)