Merge pull request #93885 from dalexeev/core-fix-freed-object-booleanization

Core: Fix `Freed Object` booleanization
This commit is contained in:
Thaddeus Crews 2024-11-11 14:18:18 -06:00
commit f233d186ef
No known key found for this signature in database
GPG Key ID: 62181B86FE9E5D84

View File

@ -951,7 +951,7 @@ bool Variant::is_zero() const {
return *reinterpret_cast<const ::RID *>(_data._mem) == ::RID(); return *reinterpret_cast<const ::RID *>(_data._mem) == ::RID();
} }
case OBJECT: { case OBJECT: {
return _get_obj().obj == nullptr; return get_validated_object() == nullptr;
} }
case CALLABLE: { case CALLABLE: {
return reinterpret_cast<const Callable *>(_data._mem)->is_null(); return reinterpret_cast<const Callable *>(_data._mem)->is_null();