Merge pull request #204 from bruvzg/fix_ref_2_variant

Fix NULL pointer dereferencing on uninstantiated Ref<T>() conversion to Variant
pull/205/head
Bastiaan Olij 2018-11-24 07:54:02 +11:00 committed by GitHub
commit 1d3dbf2c51
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
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)
{
godot::api->godot_variant_new_object(&_godot_variant, p_object->_owner);
if (p_object)
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)