Merge pull request #659 from groud/fix_null_init
Avoid crash in Variant constructor from nullptr Object*pull/664/head
commit
50512f0dee
|
@ -171,7 +171,12 @@ Variant::Variant(const godot::RID &v) {
|
||||||
}
|
}
|
||||||
|
|
||||||
Variant::Variant(const Object *v) {
|
Variant::Variant(const Object *v) {
|
||||||
from_type_constructor[OBJECT](ptr(), const_cast<GodotObject **>(&v->_owner));
|
if (v) {
|
||||||
|
from_type_constructor[OBJECT](ptr(), const_cast<GodotObject **>(&v->_owner));
|
||||||
|
} else {
|
||||||
|
GodotObject *nullobject = nullptr;
|
||||||
|
from_type_constructor[OBJECT](ptr(), &nullobject);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Variant::Variant(const Callable &v) {
|
Variant::Variant(const Callable &v) {
|
||||||
|
|
Loading…
Reference in New Issue