Fix crash when calling get_argument_count() on invalid Callable

https://github.com/godotengine/godot/issues/103438
(cherry picked from commit 7bc030172e)
This commit is contained in:
Hotkey
2025-03-04 13:32:12 +09:00
committed by Rémi Verschelde
parent 9ea8867542
commit 04c7f54e31

View File

@ -188,7 +188,7 @@ int Callable::get_argument_count(bool *r_is_valid) const {
if (is_custom()) {
bool valid = false;
return custom->get_argument_count(r_is_valid ? *r_is_valid : valid);
} else if (!is_null()) {
} else if (is_valid()) {
return get_object()->get_method_argument_count(method, r_is_valid);
} else {
if (r_is_valid) {