Skip to content

Commit 44a1a7d

Browse files
committed
Don't automatically treat numeric values as ObjectIDs
1 parent 9ae37ac commit 44a1a7d

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

src/variant/variant.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -528,6 +528,9 @@ Variant::operator PackedVector4Array() const {
528528

529529
Object *Variant::get_validated_object() const {
530530
#if GODOT_VERSION_MINOR >= 4
531+
if (get_type() != OBJECT) {
532+
return nullptr;
533+
}
531534
return ObjectDB::get_instance(operator ObjectID());
532535
#else
533536
// Note: This isn't actually validated, but we can't do any better in Godot 4.3 or earlier.

0 commit comments

Comments
 (0)