Fix NULL pointer dereferencing on uninstantiated Ref<T>() conversion to Variant

pull/204/head
bruvzg 2018-11-22 23:41:33 +02:00
parent f10ce0a6be
commit c2b59773af
No known key found for this signature in database
GPG Key ID: 89DD917D9CE4218D
1 changed files with 4 additions and 1 deletions

View File

@ -142,7 +142,10 @@ Variant::Variant(const RID& p_rid)
Variant::Variant(const Object* p_object) Variant::Variant(const Object* p_object)
{ {
if (p_object)
godot::api->godot_variant_new_object(&_godot_variant, p_object->_owner); godot::api->godot_variant_new_object(&_godot_variant, p_object->_owner);
else
godot::api->godot_variant_new_nil(&_godot_variant);
} }
Variant::Variant(const Dictionary& p_dictionary) Variant::Variant(const Dictionary& p_dictionary)