Merge pull request #90414 from jsjtxietian/assign-crash

Fix `_node_assign` will crash  when `base_node` is nullptr
This commit is contained in:
Rémi Verschelde 2024-04-09 10:42:38 +02:00
commit 8c6e8c72a2
No known key found for this signature in database
GPG Key ID: C3336907360768E1

View File

@ -2755,7 +2755,8 @@ void EditorPropertyNodePath::_node_assign() {
Variant val = get_edited_property_value();
Node *n = nullptr;
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 {
n = Object::cast_to<Node>(val);
}