Fix unsafe uses of Callable.is_null()

`Callable.is_null()` is not equivalent to `!Callable.is_valid()` and
doesn't guarantee the call is valid.
This commit is contained in:
A Thousand Ships 2024-04-27 11:56:39 +02:00
parent 6118592c6d
commit 31e7ee63f2
No known key found for this signature in database
GPG key ID: 2033189A662F8BD7
19 changed files with 40 additions and 40 deletions

View file

@ -1921,7 +1921,7 @@ void EngineDebugger::send_message(const String &p_msg, const Array &p_data) {
Error EngineDebugger::call_capture(void *p_user, const String &p_cmd, const Array &p_data, bool &r_captured) {
Callable &capture = *(Callable *)p_user;
if (capture.is_null()) {
if (!capture.is_valid()) {
return FAILED;
}
Variant cmd = p_cmd, data = p_data;