Merge pull request #103465 from Hot-key/fix-callable-get-argument-count-crash

Fix crash when calling `get_argument_count()` on Callable with freed object
This commit is contained in:
Thaddeus Crews 2025-03-05 12:07:38 -06:00
commit 6cc46e7a38
No known key found for this signature in database
GPG key ID: 62181B86FE9E5D84

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) {