Fix _node_assign
will crash when base_node is nullptr
This commit is contained in:
parent
9d6bdbc56e
commit
7d4bdcf80a
1 changed files with 2 additions and 1 deletions
|
@ -2755,7 +2755,8 @@ void EditorPropertyNodePath::_node_assign() {
|
||||||
Variant val = get_edited_property_value();
|
Variant val = get_edited_property_value();
|
||||||
Node *n = nullptr;
|
Node *n = nullptr;
|
||||||
if (val.get_type() == Variant::Type::NODE_PATH) {
|
if (val.get_type() == Variant::Type::NODE_PATH) {
|
||||||
n = get_base_node()->get_node_or_null(val);
|
Node *base_node = get_base_node();
|
||||||
|
n = base_node == nullptr ? nullptr : base_node->get_node_or_null(val);
|
||||||
} else {
|
} else {
|
||||||
n = Object::cast_to<Node>(val);
|
n = Object::cast_to<Node>(val);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue