diff --git a/src/variant/variant.cpp b/src/variant/variant.cpp index 4535f736..82b0b149 100644 --- a/src/variant/variant.cpp +++ b/src/variant/variant.cpp @@ -171,7 +171,12 @@ Variant::Variant(const godot::RID &v) { } Variant::Variant(const Object *v) { - from_type_constructor[OBJECT](ptr(), const_cast(&v->_owner)); + if (v) { + from_type_constructor[OBJECT](ptr(), const_cast(&v->_owner)); + } else { + GodotObject *nullobject = nullptr; + from_type_constructor[OBJECT](ptr(), &nullobject); + } } Variant::Variant(const Callable &v) {