gdnative bug fix in get (return null check)
This commit is contained in:
parent
2a0c0db028
commit
af8a40e554
1 changed files with 5 additions and 2 deletions
|
@ -876,10 +876,13 @@ bool GDNativeInstance::get(const StringName &p_name, Variant &r_ret) const {
|
||||||
const Variant *args[1] = { &name };
|
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);
|
godot_variant result = E->get().method.method((godot_object *)owner, E->get().method.method_data, userdata, 1, (godot_variant **)args);
|
||||||
|
if (((Variant *)&result)->get_type() != Variant::NIL) {
|
||||||
r_ret = *(Variant *)&result;
|
r_ret = *(Variant *)&result;
|
||||||
godot_variant_destroy(&result);
|
godot_variant_destroy(&result);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
godot_variant_destroy(&result);
|
||||||
|
}
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue