1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-12 13:20:55 +00:00

Core: Сheck r_error after calling callp()

This commit is contained in:
Danil Alexeev
2024-08-30 21:09:30 +03:00
parent a5830f6eb9
commit 49bcdf78a7
7 changed files with 18 additions and 14 deletions

View File

@@ -1648,14 +1648,16 @@ bool ClassDB::get_property(Object *p_object, const StringName &p_property, Varia
Variant index = psg->index;
const Variant *arg[1] = { &index };
Callable::CallError ce;
r_value = p_object->callp(psg->getter, arg, 1, ce);
const Variant value = p_object->callp(psg->getter, arg, 1, ce);
r_value = (ce.error == Callable::CallError::CALL_OK) ? value : Variant();
} else {
Callable::CallError ce;
if (psg->_getptr) {
r_value = psg->_getptr->call(p_object, nullptr, 0, ce);
} else {
r_value = p_object->callp(psg->getter, nullptr, 0, ce);
const Variant value = p_object->callp(psg->getter, nullptr, 0, ce);
r_value = (ce.error == Callable::CallError::CALL_OK) ? value : Variant();
}
}
return true;