Merge pull request #9757 from RameshRavone/patch-1

gdnative bug fix in get (return null check)
This commit is contained in:
Thomas Herzog 2017-07-22 21:06:16 +02:00 committed by GitHub
commit c74a3275dc
1 changed files with 5 additions and 2 deletions

View File

@ -876,9 +876,12 @@ bool GDNativeInstance::get(const StringName &p_name, Variant &r_ret) const {
const Variant *args[1] = { &name };
godot_variant result = E->get().method.method((godot_object *)owner, E->get().method.method_data, userdata, 1, (godot_variant **)args);
r_ret = *(Variant *)&result;
if (((Variant *)&result)->get_type() != Variant::NIL) {
r_ret = *(Variant *)&result;
godot_variant_destroy(&result);
return true;
}
godot_variant_destroy(&result);
return true;
}
return false;